💬 MySensor Dioder (Ikea)




  • Hardware Contributor

    Nice work! I'm impressed.



  • Thank you!



  • i take it i could use an Arduino nano and not have to worry about the voltage Regulator? it can take 5v or 3.3v meaning i already have all the parts to replicate this with my existing Dioder setup..:)



  • Thank you for the awesome work you have done! Would you be willing to share your OpenHAB items and sitemap setup to get this to work?



  • I'll post items, rules and sitemap as soon as I'll have the stable version.



  • This is great.

    I just got myself one of these Dioders

    Could you detail the connections between arduino and the ikea board?

    For example when you label AIN6 on the ikea board picture it connects to D6 in arduino?

    • 3 for RGB (AIN6, AIN5, AIN4) - (D6, D5, D3)
    • 3 for Buttons (OEN, AIN2, AIN3) - (D7, D4, D2)
    • 1 ground
    • 1 5v to arduino vin?
    • 1 Color Wheel (AIN7 to Arduino A0)?

    Is this correct?



  • Hi,
    3 pins for RGB: R (AIN4) -> D3; G (AIN5) -> D6; B (AIN6) -> D5
    3 pins for buttons: S1(AIN3) -> D7; S2(CEN) -> D2; S3(AIN2) -> D4
    1 ground
    1 5V to Arduino's Vcc if it is 5V version or to RAW if it is 3,3V version
    1 color wheel (AIN7) -> A0



  • Thanks @mortommy



  • please find items and rules here: https://github.com/mortommy/MySensorDioder



  • @mortommy Thank you!



  • I just updated the rules.



  • @mortommy Awesome thanks for the update!



  • Just for clarification, you posted in a comment that S3(AIN2) -> D11 but shouldn't it be D4 per schematic and source code? Also, it looks like R20 has been removed. Why was that done and is it critical to make this work? Thanks, nice work.



  • Hi @kevvette ,
    yes, my mistake, S3 goes to D4, I'll correct the post, thank you.
    Regarding the R20, it is just a jumper and first I thought I could use that point for some connection but at the end I didn't use it, so I reestablished the connection. It is not needed to remove the R20.



  • Hello,

    Very nice project!
    Is it possible to use in DOMOTICZ?

    Ton



  • Hi,

    if you are already using a gateway in Domoticz I guess so. From the mysensor point of view is a RGB sensor (or light switch or dimmer light) the source of the command sento to the serial gateway and then to the ikea mysensorized sensor it doesn't matter.



  • Hello,
    I was using your code from MySensorDioder_133.ino
    I downloaded the library from https://github.com/mysensors/MySensors
    I tried to run the code but I got a error message saying no such file located.
    These were the two files that couldn't be found
    MyTransportNRF24.h
    MySensor.h
    I was wondering if you had the same issues when you were working on the code?



  • Hi,
    yes it happens sometimes. Try to import the library by Arduino IDE (Sketch -> Include Library -> MySensors). You'll have in the sketch two new lines:

    
    #include <MyConfig.h>
    #include <MySensors.h>
    
    

    and you can delete the same lines already included in the code.

    Remember that the sketch is based on mysensor library 1.5.4 it is not converted to 2.0 yet.

    Hope it helps.



  • Thank you,

    I found those missing files and uses the mysensor library 1.5.4 but after I put all the files it asked for I got this odd message. I was looking for the error but had no luck. It says that "was not declared in this scope". Did you happened to run into this issue?

    0_1479706500439_upload-81042e07-857f-48cb-aef0-f62af70f2189



  • Have you cleaned the folder MySensor within the folder libraries before to copy the 1.5.4 one?



  • Hello
    I got lot of errors during the compiling stage. I tried to use older MySensors 1.5.4 library and Arduino 1.5.7 IDE. My question is, how to install correct MySensors library and not use anything else?



  • Delete the MySensors folder in libraries and download it again.



  • Now I downloaded Arduino IDE 1.6.5.zip, then I extracted it into C:/tools folder. Then I deleted everything from the library folder. Then I started Arduino IDE and I added MySensors-1.5.4.zip library. IDE reported that this file does not contain valid library. I closed IDE. So I unzipped MySensors-1.5.4.zip library directly into library folder. Then I started again IDE and checked that IDE can see MySensors-1.5.4 library. I opened MySensorDioder_133.ino and tried to compile it.

    Still got the following error:

    MySensorDioder_133.ino:38:30: fatal error: MyTransportNRF24.h: No such file or directory
    compilation terminated.

    How to continue?



  • Mortommy: Can you change your sketch so that it support MySensors 2.0 library?



  • Hi @pentti12 ,
    please find the sketch 2.0.0 in the project. I couldn't test it yet, I have converted it following the guidance and I just verified that it compiles successfully.



  • Sorry, but the compiler found a missing library file:

    MyTransportNRF24.h

    MySensors library 2.0 has MyTransportNRF24.cpp only



  • Hi

    I changed my Arduino IDE 1.6.11 using the MySensors development library v2.1.0-beta. Now the compiling went OK. I will continue with that. It will take few days before I have more info about how things went with actual hardware.



  • I tested this latest sketch in my actual hardware (Arduino Mega + Proto shield with additionla components + Ikea Dioder control board). I cannot get system working, nothing happens when I press UP, DOWN buttons. Led-lights stay ON after power up.
    I also tested to compile your sketch with Arduino IDE and MySensors Library V2.0.0. Compiling went OK, no progress with actual hardware.

    How can I test step by step what is happening during startup?



  • @pentti12 ,
    add the line

    #define MY_DEBUG
    

    at the begging of the sketch so via Serial Monitor you'll be able to see the messages pushed by the commands println. You can add other println commands in other point to see the steps covered.



  • OK, I added the line and now I get:

    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT

    So I have to check my radio-module or replace it with new one. I will continue ...



  • ok, something is definitely wrong with the radio module. Can you check the connection according to this page?



  • I changed my Radio-module to new one. Does not help. So I have to check my wiring on prototype board.



  • Wiring was OK, but 10uF elko is missing from the 3.3V supply. I have only 440nF capasitor at the moment. This seems to be too small value. I will have 10uF elko on next monday available. So project will take a break.



  • I added 10uF capasitor between VCC and GND pins of the radio module. I also added #define MY_DEBUG_VERBOSE_RF24 line into sketch. I got the following response:

    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    RF24:write register, reg=0, value=14
    RF24:write register, reg=3, value=3
    RF24:write register, reg=4, value=95
    RF24:write register, reg=5, value=76
    RF24:write register, reg=6, value=39
    RF24:read register, reg=6, value=255
    RF24:read register, reg=5, value=255
    RF24:Sanity check failed: configuration mismatch! Check wiring, replace module or non-P version
    !TSM:RADIO:FAIL
    !TSM:FAILURE
    TSM:PDT
    RF24:write register, reg=0, value=12
    RF24:power down

    I have changed the radio module to new one without success. So there must be some other reason why this sketch does not work in my hardware. Any ideas?



  • Which module are you using? if it is NRF24L01+ be sure it is the "plus" version.



  • At least I have ordered nRF24L01+ versions. And I use them on other MySensors node and they are working OK.



  • Update:

    I changed Arduino Board from Arduino Mega R3 to Arduino UNO board. I placed my protoshield above UNO-board and now I got following response:

    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    RF24:write register, reg=0, value=14
    RF24:write register, reg=3, value=3
    RF24:write register, reg=4, value=95
    RF24:write register, reg=5, value=76
    RF24:write register, reg=6, value=39
    RF24:read register, reg=6, value=39
    RF24:read register, reg=5, value=76
    RF24:write register, reg=16, value=115
    RF24:write register, reg=29, value=6
    RF24:write register, reg=2, value=2
    RF24:write register, reg=1, value=0
    RF24:write register, reg=28, value=3
    RF24:flushRX
    RF24:flushTX
    RF24:write register, reg=7, value=112
    TSM:RADIO:OK
    RF24:write register, reg=2, value=3
    RF24:write register, reg=1, value=1
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:ASSIGNID:OK (ID=9)
    TSM:FPAR
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=255
    RF24:write register, reg=10, value=255
    RF24:write register, reg=16, value=255
    RF24:send message to 255, len=7
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:MAX_RT
    RF24:flushTX
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=255
    RF24:write register, reg=10, value=255
    RF24:write register, reg=16, value=255
    RF24:send message to 255, len=7
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:MAX_RT
    RF24:flushTX
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    RF24:read message, len=8
    RF24:write register, reg=7, value=64
    TSP:MSG:READ 0-0-9 s=255,c=3,t=8,pt=1,l=1,sg=0:0
    TSP:MSG:FPAR RES (ID=0, dist=0)
    TSP:MSG:PAR OK (ID=0, dist=1)
    TSM:FPAR:OK
    TSM:ID
    TSM:CHKID:OK (ID=9)
    TSM:UPL
    TSP:PING:SEND (dest=0)
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=8
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
    RF24:read message, len=8
    RF24:write register, reg=7, value=64
    TSP:MSG:READ 0-0-9 s=255,c=3,t=25,pt=1,l=1,sg=0:1
    TSP:MSG:PONG RECV (hops=1)
    TSP:CHKUPL:OK
    TSM:UPL:OK
    TSM:READY
    Setup... end.
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=9
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=12
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=8
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
    RF24:read message, len=9
    RF24:write register, reg=7, value=64
    TSP:MSG:READ 0-0-9 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    Incoming message: 15
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=21
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=3,t=11,pt=0,l=14,sg=0,ft=0,st=ok:MySensorDioder
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=12
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=7
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=0,c=0,t=4,pt=0,l=0,sg=0,ft=0,st=ok:
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=7
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=1,c=0,t=26,pt=0,l=0,sg=0,ft=0,st=ok:
    Request registration...
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=8
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
    RF24:read message, len=8
    RF24:write register, reg=7, value=64
    TSP:MSG:READ 0-0-9 s=255,c=3,t=27,pt=1,l=1,sg=0:1
    Node registration=1
    Init complete, id=9, parent=0, distance=1, registration=1
    Wheel position changed.
    Wheel position: 0
    Hue value of the Wheel position: 0
    Send command to lights.
    Bright: 0
    Red: 0
    Green: 0
    Blue: 0
    RGB in HEX: 000000

    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=11
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=0,c=1,t=3,pt=4,l=4,sg=0,ft=0,st=ok:0
    RF24:stop listening
    RF24:write register, reg=0, value=14
    RF24:open writing pipe, recipient=0
    RF24:write register, reg=10, value=0
    RF24:write register, reg=16, value=0
    RF24:send message to 0, len=13
    RF24:flushTX
    RF24:write register, reg=7, value=48
    RF24:start listening
    RF24:write register, reg=0, value=15
    RF24:write register, reg=10, value=9
    TSP:MSG:SEND 9-9-0-0 s=1,c=1,t=40,pt=0,l=6,sg=0,ft=0,st=ok:000000

    Now sketch seems to work. I will continue by adding IKEA DIODER Leds. More info later.



  • Update:

    I can control locally the IKEA DIODER now. So the hardware is more or less working as expected, but do you have good instructions how I can get OpenHAB2 and MySensors Ethernet Gateway working together. Today I can see MySensors Ethernet Gateway ONLINE state and I can manually add Custom Sensor as a thing, but I cannot control items via Openhab.

    I use the latest OH2 Snapshot ( on Pine64 with Debian Jessie) and latest MySensors GatewayW5100 (library 2.0) on the MySensors Gateway (Arduino UNO based) and I have tried to start/stop/restart OH2 after MySensors Gateway is up and running without success.

    OH2 is capable to control for example Philips HUE lights without problems at the moment.



  • Great news!

    Regarding OH, I didn't have the opportunity to play with the v2.0 yet, I'm still on 1.8.1.
    I have a serial mysensors gateway and this is my set up:

    OH (v1.8.1) <-> OH MQTT binding (as MQTT client) <-> Mosquitto (as MQTT server) <-> mosquitto to serial (python script that reverts messages with topic mysensors to the serial port and vice-versa) <-> serial gateway.

    So my items in OH are based on mqtt binding.

    I guess OH2 and mysensors openhab binding make everything easier.



  • Do you have interest to try OH2 together with MySensors Ethernet Gateway to get working?

    I do not have enough force to push developers to make this happen. At the moment there is some problem on this, because full control is not possible. I think that MySensors Serial Gateway is working with OH2, but I don't like to use it. I like to connect my devices into LAN not cabling via old fashioned way using serial wires.



Suggested Topics

1
Online

11.4k
Users

11.1k
Topics

112.6k
Posts