Announcement

Collapse
No announcement yet.

New to MQTT...

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

    #16
    Originally posted by Michael McSharry View Post
    You have a couple options. It seems you have selected the Slider as the Control/Status UI on the mcsMQTT Edit tab. Sliders are normally 0 to 100% DeviceValue. If you want 3500 to 6700, for example, then use HS Device Management to change the range of values for the slider and for the graphics from the 0 and 100 to 3500 and 6700.

    Since there may be some mcsMQTT internal assumptions made about sliders, a more straightforward method is to select Number for the Control/Status UI. This will present a text box where a number can be entered from HS. This way you have direct control of what is sent in the payload. Once you have this working then you can go back and fiddle with the slider.

    Your payload template on Edit tab would likely be {"color_temp":$$VALUE:} so the data gets formatted as JSON with key color_temp and the magnitude coming from HS DeviceValue. This applies to both slider and number UI.
    I read here on github about zigbee-herdsman now supporting a "%" value.
    HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
    Plugins: Z-Wave (via Nortek USB stick

    Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
    Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
    Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
    Insteon: 2413S Dual Band PLM
    Zigbee: zzh! CC2652R Rev A
    Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

    Comment


      #17
      If they did implement percent then your payload template would change to {"color_temp":$$VALUE:%} or {"color_temp_percent":$$VALUE:} and no changes should then be needed with the slider range.

      Comment


        #18
        Click image for larger version

Name:	zigbee2mqtt percent as string.PNG
Views:	110
Size:	11.3 KB
ID:	1392917
        HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
        Plugins: Z-Wave (via Nortek USB stick

        Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
        Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
        Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
        Insteon: 2413S Dual Band PLM
        Zigbee: zzh! CC2652R Rev A
        Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

        Comment


          #19
          Originally posted by Michael McSharry View Post
          I do not know how to do a firmware update. I suspect it is from the company's App.
          Click image for larger version  Name:	OTA Update.PNG Views:	0 Size:	73.7 KB ID:	1392936Click image for larger version  Name:	OTA Update 1.PNG Views:	0 Size:	20.5 KB ID:	1392937Click image for larger version  Name:	OTA Update 2.PNG Views:	0 Size:	255.7 KB ID:	1392938

          It failed to succeed though...
          HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
          Plugins: Z-Wave (via Nortek USB stick

          Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
          Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
          Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
          Insteon: 2413S Dual Band PLM
          Zigbee: zzh! CC2652R Rev A
          Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

          Comment


            #20
            After my mod to devices.js I figured out how to remove the device from the network. I then obsoleted the topics and rejoined one bulb. It recognized my device entry in devices.js but publiched the same boring topic as before. Also mcsMQTT has not seen the topic yet...

            Click image for larger version

Name:	Remove-Rejoin.PNG
Views:	114
Size:	226.0 KB
ID:	1392969Click image for larger version

Name:	new associations.PNG
Views:	93
Size:	521.9 KB
ID:	1392970
            HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
            Plugins: Z-Wave (via Nortek USB stick

            Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
            Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
            Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
            Insteon: 2413S Dual Band PLM
            Zigbee: zzh! CC2652R Rev A
            Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

            Comment


              #21
              It looked to me as if the update was happening with progress at 4% and 1356 minutes remaining. That is a long download.

              Have you tried publishing something like the following to induce the bulb to respond with its status?

              Code:
              zigbee2mqtt/0x00158d00019949bd/set={"state":"ON"","brightness":128,"color_temp":100%}

              Comment


                #22
                Originally posted by Michael McSharry View Post
                It looked to me as if the update was happening with progress at 4% and 1356 minutes remaining. That is a long download.

                Have you tried publishing something like the following to induce the bulb to respond with its status?

                Code:
                zigbee2mqtt/0x00158d00019949bd/set={"state":"ON"","brightness":128,"color_temp":100%}
                I just tried that but it seems zigbee2mqtt/mosquitto might be fubar or something is amiss on my Deb9 box. Since yesterday or maybe even the day before, it's not been working right. I've had two windows open, one to "tail -f" your mcsMQTT Debug.txt log and the other watching zigbee2mqtt log.txt and except for the sonoff device, messages are not showing up in the z2m log. I think I am going to wipe and start over putting z2m/mosquitto on my Deb10 HS4 host. I'll have an easier time the 2nd time through this though as I've learned a lot.
                HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                Plugins: Z-Wave (via Nortek USB stick

                Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                Insteon: 2413S Dual Band PLM
                Zigbee: zzh! CC2652R Rev A
                Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                Comment


                  #23
                  So after a few hours today, I got mqtt redeployed on my Pi where my z-wave is and I managed to get one of the Adurosmart 81812 bulbs working properly (the Sonoff was easy). It's not quite the way I want it yet. I discovered that sending 1-512 to the bulb adjusts the temperature from 6000K to 2700K...kinda backwards. Also, I was unable to publish {"color_temp":"xx%"} to take advantage of the new herdsman % formatting.. As soon as I try and surround $$status: or $$value: with quotes I get 'null' in the payload. Also need to figure out how to get the HS slider to show 2700K-6000K (that part is easy) but send the payload as 512-1. Need some convoluted reverse algorithm...

                  Click image for larger version

Name:	Adurosmart 81812.PNG
Views:	99
Size:	129.7 KB
ID:	1393263
                  Attached Files
                  HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                  Plugins: Z-Wave (via Nortek USB stick

                  Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                  Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                  Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                  Insteon: 2413S Dual Band PLM
                  Zigbee: zzh! CC2652R Rev A
                  Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                  Comment


                    #24
                    In your payload template you can use inline expression. This is double less-than and double greater-than symbols encasing the expression. Something like
                    Code:
                    {"color_temp":<<512-$$VALUE:>>}
                    Don't know why quotes around $$VALUE: would give you a null result. For JSON you don't want quotes around numbers anyway. In another current thread in this forum I was helping Cor with an expression and the issue he had was the number was using comma as its decimal and when the comma was embedded in the expression it changed the meaning of the expression. This was resolved by encasing the $$VALUE: in quotes.

                    Comment


                      #25
                      Originally posted by Michael McSharry View Post
                      In your payload template you can use inline expression. This is double less-than and double greater-than symbols encasing the expression. Something like
                      Code:
                      {"color_temp":<<512-$$VALUE:>>}
                      Don't know why quotes around $$VALUE: would give you a null result. For JSON you don't want quotes around numbers anyway. In another current thread in this forum I was helping Cor with an expression and the issue he had was the number was using comma as its decimal and when the comma was embedded in the expression it changed the meaning of the expression. This was resolved by encasing the $$VALUE: in quotes.
                      Actually, I would need {"color_temp":<<513-$$VALUE:>>} to convert 1-512 to 512-1!

                      To use the herdsman % syntax the payload needs to be formatted {"color_temp":"50%"}. The second parameter needs to have " ". $$VALUE from HS is just {"color_temp":50}.

                      I figured out a formula last night in Excel to convert my desire to have 2700K-6000K in HS to 512 to 1 in the payload: =ROUND(512-((RC[-1]-2700)*(511/3300)),0)
                      I'm guessing that would look something like {"color_temp":<<ROUND(512-(($$VALUE:-2700)*(511/3300)),0)>>} ???
                      HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                      Plugins: Z-Wave (via Nortek USB stick

                      Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                      Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                      Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                      Insteon: 2413S Dual Band PLM
                      Zigbee: zzh! CC2652R Rev A
                      Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                      Comment


                        #26
                        Originally posted by dbrunt View Post
                        I figured out a formula last night in Excel to convert my desire to have 2700K-6000K in HS to 512 to 1 in the payload: =ROUND(512-((RC[-1]-2700)*(511/3300)),0)
                        I'm guessing that would look something like {"color_temp":<<ROUND(512-(($$VALUE:-2700)*(511/3300)),0)>>} ???
                        ...and the formula in reverse is =ROUND(2700-((RC[-1]-512)*(3300/511)),0)

                        Click image for larger version

Name:	Formula 512 to Kelvin.PNG
Views:	151
Size:	22.5 KB
ID:	1393536
                        HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                        Plugins: Z-Wave (via Nortek USB stick

                        Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                        Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                        Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                        Insteon: 2413S Dual Band PLM
                        Zigbee: zzh! CC2652R Rev A
                        Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                        Comment


                          #27
                          More to report...

                          I've discovered that my guess at 1 to 500 for color_temp is incorrect (and therefore my original formula).
                          The bulb appears to be using 'mireds' as per other Zigbee bulbs...
                          https://www.home-assistant.io/integrations/light.mqtt/
                          https://community.home-assistant.io/t/color-temperature-min-max-units-and-ui/4726
                          https://github.com/Koenkk/zigbee2mqtt/issues/2431
                          153 mireds = 6500 K
                          500 mireds = 2000 K


                          I noticed that the Eria bulb did not change temperature above/below a certain amount. 2700K to 6000K is only 446 to 192 mireds. I modified my inbound $$payload and publish $$value: to correctly convert to/from mireds/Kelvin. My slider in HS is now 2700K to 6000K and works as I'd expect.

                          I also discovered brightness is 0 to 254 rather than 0 to 100 (I wondered why the bulb seemed dim at 100%!!) so I modified the brightness to convert to/from 0-100%/0-254 and now I get full brightness.

                          Code:
                          round(2000-(($$payload:-500)*(4500/347)),0)
                          Code:
                          {"state":"ON","color_temp":<<round(500-(($$value:-2000)*(347/4500)),0)>>}
                          Code:
                          $$payload:/2.54
                          Code:
                          {"brightness":<<2.54*$$VALUE:>>}
                          I now need to find icons that reflect the colors of the bulb... warm/warm white, incandescent/soft white, white, daylight/daylight white, cool/cool white!

                          As an aside, Alexa cannot control the color_temp since HS does not seem to have implemented https://developer.amazon.com/en-US/d...ontroller.html, and HS only has 'Dim' and 'Color Control' for device Control Use: attributes; 'Dim' has to be 0-100 only and Color Control triggers Alexa to create an RGB type color control for it which does not work. I've logged an HS4 Feature Request but definitely not holding my breath. They do need to do something though to support Color Tunable only bulbs in the new HS4 Zigbee plugin so we'll see....
                          HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                          Plugins: Z-Wave (via Nortek USB stick

                          Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                          Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                          Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                          Insteon: 2413S Dual Band PLM
                          Zigbee: zzh! CC2652R Rev A
                          Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                          Comment


                            #28
                            Re-modified my formula since it is simply M = 1,000,000 / T or T = 1,000,000 / M where M=mireds and T=Temperature in kelvins:
                            Code:
                            1000000/$$payload:
                            {"state":"ON","color_temp":<<1000000/$$value:>>}
                            HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                            Plugins: Z-Wave (via Nortek USB stick

                            Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                            Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                            Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                            Insteon: 2413S Dual Band PLM
                            Zigbee: zzh! CC2652R Rev A
                            Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                            Comment


                              #29
                              You are becoming an expert on this bulb and the technology.

                              I have Wemo emulation enabled on my Tasmota firmware of my Garage Door Opener. I use Alexa Routines (Alex App) so Alexa will recognize Open and Close rather than needing On and Off. Hue emulation is also available. I don't know if zigbee2mqtt supports the emulations, but just throwing it out there.

                              Comment


                                #30
                                Originally posted by Michael McSharry View Post
                                You are becoming an expert on this bulb and the technology.
                                Slowly and painstakingly and with much research!
                                I have Wemo emulation enabled on my Tasmota firmware of my Garage Door Opener. I use Alexa Routines (Alex App) so Alexa will recognize Open and Close rather than needing On and Off.
                                I too use Alexa Routines to open and close my garage door - In both cases she turns on device 'Garage Door Open' which is a MIMOlite in momentary mode. I also use her to turn on my coffee machine via an eWeLink inching relay also in momentary mode but using the eWeLink Smart Home skill, not HS. I have another unit on my desk to try and flash Tasmota onto. Yet another diversion...
                                Hue emulation is also available. I don't know if zigbee2mqtt supports the emulations, but just throwing it out there.
                                Throw away! The more info the better!

                                The other issue I discovered is with MyHS. My slider in HS is 'dim' 2000K - 6500K but the slider in MyHS appears to start from 0 since 2000K is 1/3 of the way on. So, MyHS is not completely happy with my setup and Alexa has no idea how to 'dim' my 2000-6500K slider and HS Color Control only caused her to add RGB color selections. I may have to create manually triggered events in HS to select maybe 5 different colors and corresponding Alexa routines that she can 'turn on' if I want voice control and/or enable and use the "Alexa, tell HomeSeer to..." skill.
                                HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                                Plugins: Z-Wave (via Nortek USB stick

                                Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                                Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                                Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                                Insteon: 2413S Dual Band PLM
                                Zigbee: zzh! CC2652R Rev A
                                Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                                Comment

                                Working...
                                X