Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. pepson
    • Continue chat with pepson
    • Start new chat with pepson
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    pepson

    @pepson

    4
    Reputation
    225
    Posts
    688
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    pepson Follow

    Posts made by pepson

    • RE: 💬 OH MySensors RGBW Controller

      Hi
      Is any chance to implement in sketch option to Node after connect power go to state OFF. Now it go to ON. In situation when power lost and come back all leds will be ON.

      and is any chance to implement in your sketch option to add manual button to enable LEDS color WHITE ?
      Any color i want to setup by gateway but on the wall i want mount switch to enable color white and also to disable.
      Please add this if you can... In sketch setup pin on which button works and also color which should be turn on....

      posted in OpenHardware.io
      pepson
    • RE: 💬 OH MySensors RGBW Controller

      I found one bug in your project PCB. Pin from radio nae IRQ should be connect on PCB to pin 2 ARDUINO. But it is not connect. Also when i use radio RFM69HW i also need connect PIN 2 Arduino to pin DI00 on radio RFM69HW. This should be correct... Now pin 9 from radio is not connect to any pin Arduino.

      On RFM69HW all works ok. In previus post my radio is fix.

      posted in OpenHardware.io
      pepson
    • RE: 💬 OH MySensors RGBW Controller

      This from gateway:
      pi@hassbian:~/MySensors $ sudo ./bin/mysgw -d
      mysgw: Starting gateway...
      mysgw: Protocol version - 2.2.0
      mysgw: MCO:BGN:INIT GW,CP=RPNGL---,VER=2.2.0
      mysgw: TSF:LRT:OK
      mysgw: TSM:INIT
      mysgw: TSF:WUR:MS=0
      mysgw: TSM:INIT:TSP OK
      mysgw: TSM:INIT:GW MODE
      mysgw: TSM:READY:ID=0,PAR=0,DIS=0
      mysgw: MCO:REG:NOT NEEDED
      mysgw: Listening for connections on 0.0.0.0:5003
      mysgw: MCO:BGN:STP
      mysgw: MCO:BGN:INIT OK,TSP=1
      mysgw: TSF:MSG:READ,61-61-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=61
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-61-61,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,61-61-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=61
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-61-61,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,61-61-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=61
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-61-61,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,61-61-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=61
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-61-61,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,61-61-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=61
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-61-61,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0

      Other node works ok with this gateway.... Only this RGNW not working.

      This is log from gateway with connectionm with other node:
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
      mysgw: TSF:MSG:PINGED,ID=30,HP=1
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=0,t=18,pt=0,l=5,sg=0:2.2.0
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=11,pt=0,l=24,sg=0:Cover Roleta Sypialnia__
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=12,pt=0,l=4,sg=0:20.0
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=0,t=5,pt=0,l=21,sg=0:Roller Shutter for HA
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=0,t=29,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=0,t=29,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=29,pt=2,l=2,sg=0:1
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=45,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=0,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=44,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=0,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:99
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:98
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:97
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:96
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:95
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:94
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:93
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:92
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:91
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:90
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:89
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:88
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:87
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:86
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=31,pt=2,l=2,sg=0:1
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:86
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=45,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=0,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=44,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=0,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=31,pt=2,l=2,sg=0:1
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:86
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=45,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=0,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=44,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=0,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:87
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:88
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:89
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:90
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:91
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:92
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:93
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:94
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:95
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:96
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:97
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:98
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:99
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=29,pt=2,l=2,sg=0:1
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=1,t=3,pt=2,l=2,sg=0:100
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=45,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=1,t=0,pt=2,l=2,sg=0:60
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=44,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=1,t=0,pt=2,l=2,sg=0:55
      mysgw: TSF:MSG:READ,30-30-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=30
      mysgw: TSF:PNG:SEND,TO=0
      mysgw: TSF:CKU:OK
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,30-30-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=30
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
      mysgw: TSF:MSG:PINGED,ID=30,HP=1
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      mysgw: !TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=11,pt=0,l=24,sg=0:Cover Roleta Sypialnia__
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=12,pt=0,l=4,sg=0:20.0
      mysgw: TSF:MSG:READ,30-30-0,s=1,c=0,t=5,pt=0,l=21,sg=0:Roller Shutter for HA
      mysgw: TSF:MSG:READ,30-30-0,s=21,c=0,t=29,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:READ,30-30-0,s=41,c=0,t=29,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:READ,30-30-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
      mysgw: TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1

      posted in OpenHardware.io
      pepson
    • RE: 💬 OH MySensors RGBW Controller

      Hi
      I build this project but i want use it with radio RFM69HW and controller Home Assistant. But it not working with Home Assistant. Not connect with gateway on my RPI3b+. Other node with this radio connect ok. I dont know why ?Radio works and show this:


      | / |_ / | ___ _ __ ___ ___ _ __ ___
      | |/| | | | _
      \ / _ \ _ \/ __|/ _ \|
      / |
      | | | | |
      | |
      | | / | | _ \ _ | | _
      |
      | |
      |_, |/ _|| ||/_/|| |/
      |
      _/ 2.2.0

      16 MCO:BGN:INIT NODE,CP=RPNNA---,VER=2.2.0
      26 TSM:INIT
      28 TSF:WUR:MS=0
      30 TSM:INIT:TSP OK
      32 TSM:INIT:STATID=61
      34 TSF:SID:OK,ID=61
      36 TSM:FPAR
      1038 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      3045 !TSM:FPAR:NO REPLY
      3047 TSM:FPAR
      4050 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      6060 !TSM:FPAR:NO REPLY
      6062 TSM:FPAR
      7065 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      9072 !TSM:FPAR:NO REPLY
      9074 TSM:FPAR
      10076 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      12083 !TSM:FPAR:FAIL
      12085 TSM:FAIL:CNT=1
      12087 TSM:FAIL:DIS
      12089 TSF:TDI:TSL
      22093 TSM:FAIL:RE-INIT
      22095 TSM:INIT
      22097 TSM:INIT:TSP OK
      22099 TSM:INIT:STATID=61
      22104 TSF:SID:OK,ID=61
      22106 TSM:FPAR
      23109 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      25116 !TSM:FPAR:NO REPLY
      25118 TSM:FPAR
      26120 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      28127 !TSM:FPAR:NO REPLY
      28129 TSM:FPAR
      29132 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      31139 !TSM:FPAR:NO REPLY
      31141 TSM:FPAR
      32143 TSF:MSG:SEND,61-61-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      34150 !TSM:FPAR:FAIL
      34152 TSM:FAIL:CNT=2
      34154 TSM:FAIL:DIS
      34156 TSF:TDI:TSL

      posted in OpenHardware.io
      pepson
    • RE: 💬 OH MySensors RGBW Controller

      Why on 5 picture POWER MOSFET IRLM2502 is other side solder than on picture 9 ?

      posted in OpenHardware.io
      pepson
    • RE: About DS18B20 onewire.

      @flopp
      Probably tommorow I test your sketch and send you an info...

      And what you mean in sketch write Heat?

      And is any chance to modify this sketch and add value name "Description" to each sensor Dallas to send info to controller like Home Assistant to user can easily identify sensors in controller? What is what....

      posted in Hardware
      pepson
    • RE: About DS18B20 onewire.

      And you dont use library onewire.h ?

      posted in Hardware
      pepson
    • RE: About DS18B20 onewire.

      @flopp

      But for what is number 8 in this ?
      byte D[3][8] = {

      On what MySensors you use it ?
      Previous sketch your in this thread i can not compile. I convert it as i show. You mean that sketch with 2 pcs dallas should look like this:

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * DESCRIPTION
       *
       * Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
       * http://www.mysensors.org/build/temp
       */
      
      #define MY_GATEWAY_SERIAL
      
      #include <MySensors.h>  
      #include <SPI.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
      #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
      
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 16
      unsigned long SLEEP_TIME = 3000; // Sleep time between reads (in milliseconds)
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      
      byte D[2][8] = {
      { 0x28, 0xFB, 0x8F, 0x77, 0x91, 0x15, 0x02, 0x32 },
      { 0x28, 0xC5, 0xBF, 0x77, 0x91, 0x16, 0x02, 0x1D }
      };
      //MySensor gw;
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      boolean receivedConfig = false;
      boolean metric = true; 
      // Initialize temperature message
      MyMessage msg(0,V_TEMP);
      
      void before()  
      { 
        // Startup up the OneWire library
        sensors.begin();
      }
      
      void setup() 
      {
        // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
      
        // Startup and initialize MySensors library. Set callback for incoming messages. 
      //  begin();
      }
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Temp. Sensor", "1.1");
      
        // Fetch the number of attached temperature sensors  
        numSensors = sensors.getDeviceCount();
      
        // Present all sensors to controller
        for (int i=0; i<3 && i<MAX_ATTACHED_DS18B20; i++) {   
           present(i, S_TEMP);
        }
      }
      
      
      void loop()     
      {     
        
      Serial.println(millis()); 
        // Process incoming messages (like config from server)
        //process(); 
      
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i=0; i<3 && i<MAX_ATTACHED_DS18B20; i++) {
       
          // Fetch and round temperature to one decimal
          //float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(D[i]):sensors.getTempFByIndex(D[i])) * 10.)) / 10.;
          //float temperature = static_cast<float>(static_cast<int>((sensors.requestTemperaturesByAddress(D[i])) * 10.)) / 10.;
          float temperature = sensors.getTempC(D[i]);
          // Only send data if temperature has changed and no error
          #if COMPARE_TEMP == 1
          if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
          #else
          if (temperature != -127.00 && temperature != 85.00) {
          #endif
       
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          }
        }
        sleep(SLEEP_TIME);
      }
      

      And what command in sketch should be use:

      1. float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(D[i]):sensors.getTempFByIndex(D[i])) * 10.)) / 10.;
      2. float temperature = static_cast<float>(static_cast<int>((sensors.requestTemperaturesByAddress(D[i])) * 10.)) / 10.;
      3. float temperature = sensors.getTempC(D[i]);

      In original sketch from Mysensors he use this :
      float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;

      And please share me sketch which you use with MySensors 2.x and with how system controller you use it ? I want use with Home Assistant.

      posted in Hardware
      pepson
    • RE: About DS18B20 onewire.

      @mfalkvidd
      Hi
      I am not programmer and i dont know how. Is any chance to you can help me convert it to working with MySensors 2.x ?
      This sketch looks similary as standard sketch from mysensors:
      https://www.mysensors.org/build/temp

      Standard sketch works but i want use sketch with ID Dallas to write in my Home assistant to specify number child.... and when dallas destroy i replace ID in sketch write to arduino and in Home Assistant automaticaly replace it and show still correct temp to my room.

      posted in Hardware
      pepson
    • RE: About DS18B20 onewire.

      I correct this sketch But for me dont read temp.....
      standard sketch from mysensors looks similary like this read with no problem.
      https://www.mysensors.org/build/temp

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * DESCRIPTION
       *
       * Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
       * http://www.mysensors.org/build/temp
       */
      
      #define MY_GATEWAY_SERIAL
      
      #include <MySensors.h>  
      #include <SPI.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 16
      unsigned long SLEEP_TIME = 3000; // Sleep time between reads (in milliseconds)
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      
      byte D[3][8] = {
      { 0x28, 0xFB, 0x8F, 0x77, 0x91, 0x15, 0x02, 0x32 },
      { 0x28, 0xFF, 0x37, 0x77, 0x91, 0x18, 0x02, 0x16 }
      };
      //MySensor gw;
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      boolean receivedConfig = false;
      boolean metric = true; 
      // Initialize temperature message
      MyMessage msg(0,V_TEMP);
      
      void before()  
      { 
        // Startup up the OneWire library
        sensors.begin();
      }
      
      void setup() 
      {
        // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
      
        // Startup and initialize MySensors library. Set callback for incoming messages. 
      //  begin();
      }
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Temp. Sensor", "1.1");
      
        // Fetch the number of attached temperature sensors  
        numSensors = sensors.getDeviceCount();
      
        // Present all sensors to controller
        for (int i=0; i<3 && i<MAX_ATTACHED_DS18B20; i++) {   
           present(i, S_TEMP);
        }
      }
      
      
      void loop()     
      {     
        
      Serial.println(millis()); 
        // Process incoming messages (like config from server)
        //process(); 
      
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i=0; i<3 && i<MAX_ATTACHED_DS18B20; i++) {
       
          // Fetch and round temperature to one decimal
       //   float temperature = static_cast<float>(static_cast<int>((sensors.requestTemperaturesByAddress(D[i])) * 10.)) / 10.;
            float temperature = sensors.getTempC(D[i]);
          // Only send data if temperature has changed and no error
          #if COMPARE_TEMP == 1
          if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
          #else
          if (temperature != -127.00 && temperature != 85.00) {
          #endif
       
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          }
        }
        //gw.sleep(SLEEP_TIME);
      }
      
      posted in Hardware
      pepson