Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Mi-Light controller for Mysensors

Mi-Light controller for Mysensors

Scheduled Pinned Locked Moved My Project
69 Posts 15 Posters 38.0k Views 27 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • n1ck1355N Offline
    n1ck1355N Offline
    n1ck1355
    wrote on last edited by n1ck1355
    #48

    @Jason-Brunk
    unfortunately i havnt got my own milight bulbs but for what i've seen on the
    reverse engineered protocol page the payload must be something like
    "07B0F2EA359001B9ACF9" for all on or
    "07B0F2EA7D910FD4EC72" for green

    or the part "07B0F2EA" must be the ID so the payload
    is somethink like "359001B9ACF9" for all on and
    "7D910FD4EC72" for green

    1 Reply Last reply
    0
    • n1ck1355N Offline
      n1ck1355N Offline
      n1ck1355
      wrote on last edited by
      #49

      @ted are you there and can get a hint please? :)

      T 1 Reply Last reply
      0
      • n1ck1355N n1ck1355

        @ted are you there and can get a hint please? :)

        T Offline
        T Offline
        ted
        wrote on last edited by
        #50

        @n1ck1355 @Jason-Brunk
        sorry i'm been really busy with job recently. I used openhab to send the payload to V_VAR1 and S_CUSTOM. When I get home tonight, I'll post the openhab rule file so people can get some sense how to control color.

        1 Reply Last reply
        0
        • n1ck1355N Offline
          n1ck1355N Offline
          n1ck1355
          wrote on last edited by
          #51

          that's really great :) Thanks!

          T 1 Reply Last reply
          0
          • n1ck1355N n1ck1355

            that's really great :) Thanks!

            T Offline
            T Offline
            ted
            wrote on last edited by
            #52

            @n1ck1355
            sorry for the delay. Here is what I learned from https://hackaday.io/project/5888-reverse-engineering-the-milight-on-air-protocol

            Basically, the mi controller will receive text string and convert them into HEX format and send it to the bulb. The text string should be formatted as the following (+ added for easy of reading, no '+' in the actual command):

            ID + color + brightness + button code + seq

            The ID is the ID of the bulb to be controlled, it is six byte in ASCII but will be converted into 3 byte HEX before sending to the bulb.
            color, brightness and button code are each 2 byte in ASCII and will be converted into 1 byte HEX and send to bulb.
            Seq is 2 byte in ASCII but it appears that you can just use "00".

            To change color, you need to send a color code (e.g.: "00"=purple, "1B"=red, "40"=yellow,e tc) and using button code "OF".
            To change back to white, you use "04" as color code and "13" as button code.

            The detailed button code definition can be found here:
            https://cdn.hackaday.io/images/1224221432724803073.jpg

            Hope this helps.

            1 Reply Last reply
            0
            • n1ck1355N Offline
              n1ck1355N Offline
              n1ck1355
              wrote on last edited by
              #53

              Thank you @ted :)
              i already played with it and can turn the bulbs on/off. i will play around with your
              information to make the other funktions work.

              But what i see is that you cannot e.g. dim the bulbs softly from say 100% to 20% cause
              that would be more commands behind each other. But the node must reset itself after
              each command by calling _Begin() and that takes some time..
              any suggestions to resolve that?

              T 1 Reply Last reply
              0
              • n1ck1355N n1ck1355

                Thank you @ted :)
                i already played with it and can turn the bulbs on/off. i will play around with your
                information to make the other funktions work.

                But what i see is that you cannot e.g. dim the bulbs softly from say 100% to 20% cause
                that would be more commands behind each other. But the node must reset itself after
                each command by calling _Begin() and that takes some time..
                any suggestions to resolve that?

                T Offline
                T Offline
                ted
                wrote on last edited by
                #54

                @n1ck1355
                my only solution is to use two radios, one receives command from the gateway and the other sending command to the bulbs. it might be doable with just 1 arduino by using softSPI.

                Nca78N 1 Reply Last reply
                0
                • T ted

                  @n1ck1355
                  my only solution is to use two radios, one receives command from the gateway and the other sending command to the bulbs. it might be doable with just 1 arduino by using softSPI.

                  Nca78N Offline
                  Nca78N Offline
                  Nca78
                  Hardware Contributor
                  wrote on last edited by
                  #55

                  @ted said:

                  @n1ck1355
                  my only solution is to use two radios, one receives command from the gateway and the other sending command to the bulbs. it might be doable with just 1 arduino by using softSPI.

                  I don't see why you would need SoftSPI for that ? It should just need some change for CE and CSN pins for the NRF that is used to send data to the milights. I will try to find time to check that this week.

                  1 Reply Last reply
                  0
                  • n1ck1355N Offline
                    n1ck1355N Offline
                    n1ck1355
                    wrote on last edited by
                    #56

                    @Nca78 :

                    did you have success with thw NRF boards connecting?

                    Nca78N 1 Reply Last reply
                    0
                    • n1ck1355N n1ck1355

                      @Nca78 :

                      did you have success with thw NRF boards connecting?

                      Nca78N Offline
                      Nca78N Offline
                      Nca78
                      Hardware Contributor
                      wrote on last edited by
                      #57

                      @n1ck1355 said:

                      @Nca78 :

                      did you have success with thw NRF boards connecting?

                      Hello, unfortunately I had no time to test it, I was busy with my Livolo switch :P

                      1 Reply Last reply
                      0
                      • Cliff KarlssonC Offline
                        Cliff KarlssonC Offline
                        Cliff Karlsson
                        wrote on last edited by
                        #58

                        I just tried out openhab2, would it be easier controling the bulbs from openhab2 or do I still to do alot of "coding" on my own?

                        1 Reply Last reply
                        0
                        • Nca78N Offline
                          Nca78N Offline
                          Nca78
                          Hardware Contributor
                          wrote on last edited by Nca78
                          #59

                          Hello, few months have passed and I finally had a look at the code from @Jason-Brunk
                          I made a MiLightBulb class with methods to set on/off, set brightness level, set color and set animation. It still needs improvements as brightness is not working, some colors are a bit off and I didn't test animation yet but it's starting to take shape and I can use it from RGB light control in domoticz.

                          I have connected 2 nrf24 also, using pins 7&8 for the one sending MiLight messages instead of 9&10 and it running fine as expected, no use to call begin() all the time: much more reactive.
                          I'll publish the code as soon as I have time to finish and clean up.

                          1 Reply Last reply
                          3
                          • Cliff KarlssonC Offline
                            Cliff KarlssonC Offline
                            Cliff Karlsson
                            wrote on last edited by
                            #60

                            Great news @Nca78

                            1 Reply Last reply
                            1
                            • CrankyCoderC Offline
                              CrankyCoderC Offline
                              CrankyCoder
                              wrote on last edited by
                              #61

                              any updates? I have a couple milight bulbs ready to test :)

                              Home Automation Tinkerer
                              www.CrankyCoder.net

                              Controller: HomeAssistant in Kubernetes
                              Gateway: MQTTClientGateway
                              MySensors: 2.3

                              Nca78N 1 Reply Last reply
                              1
                              • CrankyCoderC CrankyCoder

                                any updates? I have a couple milight bulbs ready to test :)

                                Nca78N Offline
                                Nca78N Offline
                                Nca78
                                Hardware Contributor
                                wrote on last edited by
                                #62

                                @Jason-Brunk sorry I received my PCBs for Livolo switches so these will have my priority at the moment. And we're still in the lunar new year holidays here, not much time available.

                                1 Reply Last reply
                                0
                                • CrankyCoderC Offline
                                  CrankyCoderC Offline
                                  CrankyCoder
                                  wrote on last edited by
                                  #63

                                  Totally understand. That's another project I am interested in :)

                                  Home Automation Tinkerer
                                  www.CrankyCoder.net

                                  Controller: HomeAssistant in Kubernetes
                                  Gateway: MQTTClientGateway
                                  MySensors: 2.3

                                  1 Reply Last reply
                                  0
                                  • lozzer65L Offline
                                    lozzer65L Offline
                                    lozzer65
                                    wrote on last edited by
                                    #64

                                    Hi

                                    I have read through this thread fully and the concept look great. I am confused as to the hardware that is required thought. I have a mysensors gateway connetcted to wifi and some sensors setup and working on Home Assistant. What do I need to build to implement this solution, and what would I have to install in HA.

                                    Thanks for any help
                                    Laurie

                                    1 Reply Last reply
                                    0
                                    • D Offline
                                      D Offline
                                      Dlay
                                      wrote on last edited by
                                      #65

                                      Hello,

                                      is this thread still alive ?
                                      I am on a Raspberry Pi 3 an i have connected an nrf radio.

                                      PiGateway or PiGatewaySerial are both working and also openmilight_pi is compiled and ready.

                                      My Problem is:
                                      In the first post its said to send multiple On commands to the milight to pair it.
                                      This shall work even without the original remote controller.

                                      But how ?

                                      How to use the Gateway or openmilight to send a general on command ?
                                      I cannot see it from the hackaday page. Everywhere the ID is needed. Which i dont have when using only Pi, nRF and a milight rgb box to controll a strip.

                                      Please can someone light me up ???

                                      alexsh1A 1 Reply Last reply
                                      0
                                      • D Dlay

                                        Hello,

                                        is this thread still alive ?
                                        I am on a Raspberry Pi 3 an i have connected an nrf radio.

                                        PiGateway or PiGatewaySerial are both working and also openmilight_pi is compiled and ready.

                                        My Problem is:
                                        In the first post its said to send multiple On commands to the milight to pair it.
                                        This shall work even without the original remote controller.

                                        But how ?

                                        How to use the Gateway or openmilight to send a general on command ?
                                        I cannot see it from the hackaday page. Everywhere the ID is needed. Which i dont have when using only Pi, nRF and a milight rgb box to controll a strip.

                                        Please can someone light me up ???

                                        alexsh1A Offline
                                        alexsh1A Offline
                                        alexsh1
                                        wrote on last edited by
                                        #66

                                        @Dlay I think there has been little activity on this thread. I had some issues too and I ended up buying Wifi module to control LED strip. It is natively supported by Domoticz so it works fine for me.

                                        1 Reply Last reply
                                        0
                                        • Nca78N Offline
                                          Nca78N Offline
                                          Nca78
                                          Hardware Contributor
                                          wrote on last edited by
                                          #67

                                          Hello, I'm testing my MiLight shield for NModule, and so far it's working well, so I'll post some code soon.
                                          Even without the NModule and MiLight controller shield it will be possible to use the same wiring to build one.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          11

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular