Announcement

Collapse

Contacting HomeSeer This Week

HomeSeer is open and operational this week. All orders are being processed and shipped as usual. However, some staff are working from home. If you need to contact HomeSeer for support or customer service, please use our Email or Chat options. https://homeseer.com/contact-us/
See more
See less

Under kitchen cabinet LED lamps with mcsMQTT control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • the firmware uses MQTT to communicate with Homeseer?

    Yes.

    Here is an example of one of Michael's mcsMQTT plugin hardware project found in the documentation attached.

    This project is a garage door opener button, door open/closed sensor and added a temperature sensor to the SonOff WiFi basic device with upgraded mcsTasmota firmware.

    Click image for larger version  Name:	GDO1.jpg Views:	1 Size:	21.9 KB ID:	1261610


    Here is an example of the RGB using mcsMQTT plugin for a test RGB configuration here. (5 channels RGB WW W)

    Click image for larger version  Name:	rgb.jpg Views:	1 Size:	48.1 KB ID:	1261611
    xxxx

    Last edited by Pete; November 24th, 2018, 12:43 AM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
    HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

    Comment


    • Originally posted by Pete View Post
      This project is a garage door opener button, door open/closed sensor and added a temperature sensor to the SonOff WiFi basic device with upgraded mcsTasmota firmware.
      Thanks Pete, I'm currently testing Garadget opener controller - pretty cool open source based on Photon Particle module - in latest firmware they added MQTT support, so I need to start learning MQTT. Was trying to avoid it as from my understanding it also requires MQTT server setup, but I always try to KISS

      Comment


      • You just need a Mosquitto broker running. It'll run on Linux or Windows. I've run it here on Intel, AMD or Arm CPUs and micro OpenWRT routers.

        The Garadget is an interesting device. I like the laser sensor.

        Once you start tinkering with Mosquitto you will not be looking back.

        Here very analog and try to not have dependencies on the cloud. That is me.

        Garage door old is still wired with up and down reed sensors to the Leviton Combo security automation panel.

        Testing the SonOff GDO stuff with parallel analog sensors for speed et al. Been using VPN for a few years now for remote access.

        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
        HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

        Comment


        • Since I have Z-Wave already - I decided to KISS and use FIBARO Universal Binary Sensor- it's got two digital inputs and two outputs, ideal for two reed sensors and up/down control. Also supports up to 4 temperature sensors. Haven't received it yet though.

          Comment


          • Yes; Mosquitto has become a automation language protocal that provides the glue that binds multiple mechanisms of automation to one simple language.

            The programmable ESP8266 combo WiFi device in one small package is wonderous....

            ESP8266 based devices like iTead Sonoff with web, timers, 'Over The Air' (OTA) firmware updates and sensors support, allowing control under Serial, HTTP, MQTT and KNX, so as to be used on Smart Home Systems.

            Written for Arduino IDE and PlatformIO.

            Been tinkering here with Tasmota, ESPeasy, ESPurna firmware. All of it is impressive and easy peasey stuff.
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
            HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

            Comment


            • To avoid some potential confusion I want to clarity MQTT vs. Mosquitto. MQTT is a protocol that allows communication between clients and a broker. mcsMQTT is one instance of a client. A Sonoff device running Tasmota is another instance of a client. Mosquitto is one of several implementations of a broker.

              Clients publish messages. Broker reads all published messages. Broker forwards the messages to the clients based upon what the client has asked to receive (subscribed).

              From a black box view it looks like clients are exchanging data, but when opening the box one sees that that there is no direct communications between clients, but everything is routed by the broker. Besides routing it has responsibility to guarantee a quality of service so that, for example, if a client is offline then the broker will hold the message until the client comes online.

              Comment


              • Got the MagicHome controllers yesterday.

                Wow these are very tiny compared to the H801A RGB controller.

                I will have no issues mounting these inside of the case that I used for the SonOff SV with pot.

                These will not be utilized for RGB control rather only one channel dimming with POT for the under the kitchen counter LED strips mounted on the aluminum tracks with diffusers.


                What is the 3 wire connector (blue black red) for? Looks a bit like a usb port with a black cover on it.

                Ah...figured it out. The remove controller is an IR remote controller and the end connector is an IR receiver which I will never use.

                So then I can just strip the end off and use the wires connected to it....3.3VDC, Ground and GPIO4??

                So for soldering just need RX, TX and GPIO 0 pins to solder wires and will utilize 3.3 VDC and ground wires from the IR reciever.

                What pins will I need to solder to for the digital pot?

                Here are a couple of HD pictures of the board.

                Click image for larger version  Name:	MHback-1.jpg Views:	2 Size:	95.5 KB ID:	1261904

                Click image for larger version  Name:	MHback-2.jpg Views:	2 Size:	95.5 KB ID:	1261905

                Click image for larger version  Name:	MHFront-1.jpg Views:	1 Size:	106.9 KB ID:	1261906

                Your idea of bulk purchase, updating and wiring these is a good idea as this is not a newbie soldering endeavor.

                That said for my purposes and use of the small case I can leave the JTAG wires in place plus the GPIO wires in place for the digital pot.

                Wired 6 wires to pads even though really need only 3 wires for firmware update.

                1 - Red to V33
                2 - Black to GND pad #1
                3 - Black to GND pad #2
                4 - White to RX pad - GPIO 3
                5 - Yellow to TX pad - GPIO 1
                6 - Green to (GP)IO 0 pad - GPIO 0

                Click image for larger version  Name:	wiredmagichome.jpg Views:	1 Size:	111.7 KB ID:	1261985

                Guessing and looking at the pads that I did not create any shorts. That said the board is so cheap that doing this over again is not a big deal.

                IR Pins are VCC, Ground and Data

                Data pin for IR is GPIO 4 such that may repurpose this for a DS18B20 temperature sensor. Easy peasy stuff.

                LED connector

                1 - VCC Pin
                2 - GPIO12 - (PWM3) Blue color on the LED strip
                3 - GPIO05 - (PWM2) Green color on the led strip
                4 - GPIO13 - (PWM1) Red color on the LED strip

                Using Pin #1 and Pin #2 for single color SMD5050 LED lamps

                To update firmware connecting programmer to RX, TX and Ground only

                1 - connect RX, TX and ground pins to programmer
                2 - connect GPIO 0 wire to ground
                3 - power up RGB controller with 12VDC power supply via barrel connector
                4 - disconnect GPIO 0 wire from ground

                Going to upload Espurna Firmware espurna-1.13.3-magichome-led-controller.bin to test firmware upload.

                Using following command line via Linux.

                esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 espurna-1.13.3-magichome-led-controller.bin

                Wired up and connected programmer.

                esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 espurna-1.13.3-magichome-led-controller.bin
                esptool.py v2.3.1
                Connecting....
                Detecting chip type... ESP8266
                Chip is ESP8285
                Features: WiFi, Embedded Flash
                Uploading stub...
                Running stub...
                Stub running...
                Configuring flash size...
                Compressed 499040 bytes to 360074...
                Wrote 499040 bytes (360074 compressed) at 0x00000000 in 31.8 seconds (effective 125.7 kbit/s)...
                Hash of data verified.

                Leaving...
                Hard resetting via RTS pin...

                Configured ESPurna via web while in AP mode.

                1 - power up MagicHome controller
                2 - search for a new WAP
                3 - user = admin password=fibonacci
                4 - log in to AP which creates a new subnet and changes your IP to 192.168.4.2.
                5 - prompts you to change your password. Change the password
                6 - go to wifi configuration and put in your home or testing WAP SSID and password and static IP and subnet and gateway and DNS.
                7 - save
                8 - reboot or power off and power on your magichome controller
                9 - connect your computer back to your network and log in to the MagicHome controller with Espurna firmware.


                Click image for larger version  Name:	EspurnaMagicHome.jpg Views:	1 Size:	66.4 KB ID:	1261987


                After update of firmware will put board inside of the old SV case and connect input 12 VDC pieces and output of one channel to current under the counter LED strip and test one channel dimming and on/off. Later will remove old analog pot and replace and wire in digital on/off rotary pot.



                xxxx
                Last edited by Pete; November 25th, 2018, 07:47 PM.
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
                HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                Comment


                • Update December 2, 2018

                  Installed the Magic Home controller inside of the old SonOff SV box. Connected LED under counter lamps to one channel. Works great.

                  Started on second Magic Home controller. Decided to add a temperature sensor after installation of the digital pot.

                  LED lamps will be on 24/7 and will have automated dimming.
                  - Pete

                  Auto mator
                  Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
                  Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
                  HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

                  X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                  Comment


                  • Wires connected and testing:

                    LED SMD5050 is connected to:

                    LED Pins

                    1 - VCC
                    2 - GPIO12 - (PWM3) Blue color on the LED strip used for single color SMD5050

                    Wires for DHT22 taken from IR controller

                    1 - VCC
                    2 - Ground
                    3 - GPIO 14

                    Other wires out from Magic Home Controller

                    1 - GPIO 0 (reset wire used for programming)
                    2 - GPIO 3 RX wire
                    3 - GPIO 1 TX wire

                    Spare wires out from Magic Home Controller
                    1 - Ground (x2)
                    2 - 3.3 VDC

                    Rewired the terminals configured on both sides to coaxial female barrel connectors such that:

                    Mini wall plate will be female barrel connector ==> short 2 sided male 12 VDC coaxial plugs ==> one side female connector ==> LED side female connector to LED strip coaxial connector. Makes the concocation more plug n play than the terminal connections.

                    Putting the case back on to the Magic Home controller with removed / replaced power leads.

                    Building a second box with an identical set up for LED set #2.

                    John,

                    Did you upload the bin file for the above set up with single channel LED and DHT22 on GPIO 14?

                    The POT button goes to GPIO 0 and ??

                    The other three leads for the Encoder POT are GPIO 1 and GPIO 3 and ???

                    - Pete

                    Auto mator
                    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
                    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
                    HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

                    X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                    Comment


                    • Built two of these for 1 channel SMD5050 LED control using the Magic Home controllers updated with Espurna firmware. I velcro these under the kitchen counters. Using a female barrel connector mounted on a piece of wood for switched 12VDC power from new 2 AMP LED drivers in electrical box. LED lamps work with and without said controller.

                      Click image for larger version

Name:	RGB-1Channel.jpg
Views:	80
Size:	52.4 KB
ID:	1264725

                      - Pete

                      Auto mator
                      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
                      Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
                      HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                      Comment


                      • I programmed the magichome controller with the latest Espurna firmware and I am having difficulty understanding why this firmware is preferable over others. I have 2.5 issues that come up right away.

                        The first is the UI on the Espurna status page. I have tried both RGB and HSV and neither one produces the desired color/brightness control of the LED strip I am using. The browser UI looks great, but color space does not reflect my LED strip color space. It is 120 degrees off in the color wheel. Command yellow, get pink. Command blue get green. Command red, get purple. {edit} Reloaded firmware with the -20 version. Now color wheel is good {end edit}

                        It could be that the wiring in my strip is different than what Espurna expects, but I thought these were standardized. My strip has white, green, red and blue wires where the white is keyed with arrow and orientation matches the nomenclature on the magichome case. The controller and remote that come with the LED strip does produce the commanded red, green and blue lighting.

                        The second is that the MQTT interface is a channel 1,2,3,4 one and not a RGB one. The HS Color Picker produces RGB commands, but Espurna is expecting four independent channel commands. {edit} I see that MQTT does include the RGB along with the channel so this takes care of the issue, albeit when I command Green I get Orange lights. The Espurna color wheel does think it is green per the MQTT command. So just the first issue of mapping; {end edit}

                        The next 1/2 issue is the same as the second, but it is Alexa rather than HS is delivering the command. I can tell Alexa to "Turn Channel 1 to 30 percent" and the LED bulbs will change, but I as a user have no idea what it means to my lighting to change a channel. Perhaps if the RGB UI in Espurna status page worked correctly for me then commanding channel 0 to brightness level would result in the amount of red in the LED. While not ideal it is usable. The other color Wifi bulb I have used is able to do "Alexa, turn light green". It was just primary and secondary colors, but from voice command that seemed all I would remember anyway.

                        What I am I doing wrong or what is the advantage of Espurna for color LED control? {edit} never mind changed binary and works now. Retained the monolog in case others run into same {end edit}

                        Comment


                        • The first is the UI on the Espurna status page. I have tried both RGB and HSV and neither one produces the desired color/brightness control of the LED strip I am using. The browser UI looks great, but color space does not reflect my LED strip color space. It is 120 degrees off in the color wheel. Command yellow, get pink. Command blue get green. Command red, get purple.

                          It could be that the wiring in my strip is different than what Espurna expects, but I thought these were standardized. My strip has white, green, red and blue wires where the white is keyed with arrow and orientation matches the nomenclature on the magichome case. The controller and remote that come with the LED strip does produce the commanded red, green and blue lighting.


                          There is a thread about this over (not using Espurna) here ==>

                          Help Needed: Magic Home Led Controller shows wrong colours through Google Home. Any way to fix this?

                          Maybe just swap the red and green channels?

                          Just updated the firmware on Magic Home controller #2 but only to utilize one color as the first one I configured and noticed that my configuration for just dimming on one channel did not work until I rebooted it via the gui. Difficult to solder (well time consuming) to the pads versus the H801 RGB controller.

                          The H801 is working fine with Espurna and 5 channels of colors RGB W and WW.

                          It was much easier to work on than the Magic Home controller.

                          Not sure on the second question Michael. I went back to testing using mcsMQTT per channel brightness instead of the color wheel.

                          Haven't tried using Alexa with color commands yet even though I can see all three RGB controllers and tinkering a bit with Home Assistant.

                          Personally I like the Espurna firmware because I can configure the device from boot up after firmware upgrade in about a minute or so using WAP mode, static IP address, more than two WAPs (keep playing here with autonomous OpenWRT WAPs for WiFi devices), NTP....
                          - Pete

                          Auto mator
                          Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
                          Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
                          HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

                          X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                          Comment


                          • Just a suggestion, maybe time to move to newer technology like Programmable Individual Addressable LED (i.e. WS2812), it's getting affordable and it's cool!

                            Comment


                            • John, now that I got over my initial experience wit Led and Espurna I am ready to add local control for brightness and on/off. What wiring and firmware do I need to replicate what you show on your YouTube video?

                              Comment


                              • John configured the pot using RX / TX GPIOs and center is ground. The on / off button is GPIO 0. The DHT-22 is using GPIO 4. (optional).


                                // Encoder
                                // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
                                // when the button is not pressed, and the overall brightness when pressed
                                // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
                                // when the button is not pressed, and the second channel when pressed
                                // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
                                #define ENCODER_SUPPORT 1
                                #define ENCODER1_PIN1 1
                                #define ENCODER1_PIN2 3
                                #define ENCODER1_BUTTON_PIN 14 // using dummy gpio so encoder functions pressed or not the same
                                #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
                                #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
                                #define ENCODER1_MODE ENCODER_MODE_RATIO

                                #ifndef DHT_SUPPORT
                                #define DHT_SUPPORT 1
                                #endif
                                #define DHT_PIN 4

                                Just waiting here on the compiled version with the DHT22 feature.
                                - Pete

                                Auto mator
                                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb- Mono 6.8X
                                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.8X
                                HS4 pro - 4.0.3.0 - Ubuntu 18.04/W7e 64 bit Intel Kaby Lake CPU - 32Gb - Mono 6.8X

                                X10, UPB, Zigbee, ZWave and Wifi MQTT automation. OmniPro 2, Russound zoned audio, Smartthings hub, Hubitat Hub, and Home Assistant

                                Comment

                                Working...
                                X