Announcement

Collapse
No announcement yet.

Dropping Z-wave over MQTT and Shelly

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

    #16
    Great, it works !!!

    Can I pool the device when needed, like Z-wave does? What would be the command for that?

    Thank you

    Comment


      #17
      If you type status in the Tasmota console it should send status of each property. If you type power then it will report relay status.

      If you want polling at some rate then setup the rate in Tasmota Logging. If you want status/power on demand (poll) then use HS event with mcsMQTT send message action where the topic is the what you have setup in Tasmota as the topic with suffix of /status or /power depending upon what info you want. The payload will be blank so the action text box will look like widget/status= as an example.

      There is a Tasmota command reference that will show with Google search of Tasmota Commands. Any command without a payload is a request for the current value.

      Comment


        #18
        Hi.

        I managed to get ON/OFF working via events:
        150-Plug/cmnd/POWER=ON
        150-Plug/cmnd/POWER=OFF

        But I can not trigger the pool no matter what I enter.

        This is the line I should POOL.
        23/10/2020 20:33:58 8007660 | ActoOnMessageForTrigger Topic 150-Plug/tele/SENSOR,Payload={"Time":"2020-10-23T20:33:57","ENERGY":{"TotalStartTime":"2020-10-21T20:12:06","Total":0.299,"Yesterday":0.134,"Today":0.000," Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Fac tor":0.00,"Voltage":230,"Current":0.000}}

        I tried many options
        150-Plug/cmnd/SENSOR=
        150-Plug/tele/SENSOR=
        150-Plug/tele/ENERGY=
        150-Plug/tele/SENSOR:ENERGY:Voltage
        150-Plug/tele/SENSOR:ENERGY:Current

        nothing works. Any ideas what else to try?


        here is the log:
        Code:
        23/10/2020 20:33:58 8007660 | ActoOnMessageForTrigger Topic 150-Plug/tele/SENSOR,Payload={"Time":"2020-10-23T20:33:57","ENERGY":{"TotalStartTime":"2020-10-21T20:12:06","Total":0.299,"Yesterday":0.134,"Today":0.000," Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Fac tor":0.00,"Voltage":230,"Current":0.000}}
        23/10/2020 20:34:03 8012560 | ManageNewMessage 150-Plug/tele/HASS_STATE
        23/10/2020 20:34:03 8012560 | ActoOnMessageForTrigger Topic 150-Plug/tele/HASS_STATE,Payload={"Version":"6.7.1(basic)","BuildDateTime" :"2020-06-29T09:09:28","Core":"2_6_1","SDK":"2.2.2-dev(bb83b9b)","Module":"Delock 11827","RestartReason":"Power on","Uptime":"0T00:16:22","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:06","MqttCount":1,"BootCount":21,"SaveCou nt":302,"IPAddress":"192.168.6.150","RSSI":"100","LoadAvg":1 9}
        23/10/2020 20:34:08 8017573 | Update Accepted 214 to ON StatusType=1 Payload= ON RegExValue=ON
        23/10/2020 20:34:08 8017575 | Updating Device from 1 PayloadNumeric=False
        23/10/2020 20:34:08 8017575 | Button Value 1, prior value = 1, for VSP of ON
        23/10/2020 20:34:08 8017575 | ManageNewMessage 150-Plug/tele/STATE
        23/10/2020 20:34:08 8017575 | ActoOnMessageForTrigger Topic 150-Plug/tele/STATE,Payload={"Time":"2020-10-23T20:34:07","Uptime":"0T00:16:27","UptimeSec":987,"Vcc":3.3 81,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19," MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"Dali 2.4G","BSSId":"D8:47:32:4E:25:3C","Channel":2,"RSSI":100,"Li nkCount":1,"Downtime":"0T00:00:06"}}
        23/10/2020 20:34:08 8017615 | Update Accepted 215 to 2020-10-21T20:12:06 StatusType=2 Payload= 2020-10-21T20:12:06 RegExValue=2020-10-21T20:12:06
        23/10/2020 20:34:08 8017616 | Updating Device from 0 PayloadNumeric=False
        23/10/2020 20:34:08 8017617 | Update Accepted 216 to 0.299 StatusType=2 Payload= 0.299 RegExValue=0.299
        23/10/2020 20:34:08 8017618 | Updating Device from 299 PayloadNumeric=True
        23/10/2020 20:34:08 8017619 | Update Accepted 217 to 0.134 StatusType=2 Payload= 0.134 RegExValue=0.134
        23/10/2020 20:34:08 8017621 | Updating Device from 134 PayloadNumeric=True
        23/10/2020 20:34:08 8017622 | Update Accepted 218 to 0.000 StatusType=2 Payload= 0.000 RegExValue=0.000
        23/10/2020 20:34:08 8017623 | Updating Device from 0 PayloadNumeric=True
        23/10/2020 20:34:08 8017624 | Update Accepted 219 to 0 StatusType=2 Payload= 0 RegExValue=0
        23/10/2020 20:34:08 8017625 | Updating Device from 0 PayloadNumeric=True
        23/10/2020 20:34:08 8017626 | Update Accepted 220 to 0 StatusType=2 Payload= 0 RegExValue=0
        23/10/2020 20:34:08 8017627 | Updating Device from 0 PayloadNumeric=True
        23/10/2020 20:34:08 8017627 | Update Accepted 221 to 0 StatusType=2 Payload= 0 RegExValue=0
        23/10/2020 20:34:08 8017628 | Updating Device from 0 PayloadNumeric=True
        23/10/2020 20:34:08 8017629 | Update Accepted 222 to 0.00 StatusType=2 Payload= 0.00 RegExValue=0.00
        23/10/2020 20:34:08 8017630 | Updating Device from 0 PayloadNumeric=True
        23/10/2020 20:34:08 8017630 | Update Accepted 223 to 229 StatusType=2 Payload= 229 RegExValue=229
        23/10/2020 20:34:08 8017632 | Updating Device from 230 PayloadNumeric=True
        23/10/2020 20:34:08 8017632 | HSEvent VALUE_CHANGE| 1024| tele| 229| 230| 223
        23/10/2020 20:34:08 8017632 | Update Accepted 224 to 0.000 StatusType=2 Payload= 0.000 RegExValue=0.000
        23/10/2020 20:34:08 8017634 | Updating Device from 0 PayloadNumeric=True
        23/10/2020 20:34:08 8017635 | ManageNewMessage 150-Plug/tele/SENSOR
        23/10/2020 20:34:08 8017635 | ActoOnMessageForTrigger Topic 150-Plug/tele/SENSOR,Payload={"Time":"2020-10-23T20:34:07","ENERGY":{"TotalStartTime":"2020-10-21T20:12:06","Total":0.299,"Yesterday":0.134,"Today":0.000," Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Fac tor":0.00,"Voltage":229,"Current":0.000}}
        23/10/2020 20:34:13 8022577 | ManageNewMessage 150-Plug/tele/HASS_STATE
        23/10/2020 20:34:13 8022577 | ActoOnMessageForTrigger Topic 150-Plug/tele/HASS_STATE,Payload={"Version":"6.7.1(basic)","BuildDateTime" :"2020-06-29T09:09:28","Core":"2_6_1","SDK":"2.2.2-dev(bb83b9b)","Module":"Delock 11827","RestartReason":"Power on","Uptime":"0T00:16:32","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:06","MqttCount":1,"BootCount":21,"SaveCou nt":302,"IPAddress":"192.168.6.150","RSSI":"100","LoadAvg":1 9}
        Thank you
        Br,
        Dali

        Comment


          #19
          I just did a test using the following event. Note my topics are setup without %prefix% so /cmnd/ goes in the middle of the request. In your case it would be at the start such as "cmnd/150-Plug/STATUS=". This is because your Full Topic setup in Tasmota is %prefix%/%topic%.

          Click image for larger version  Name:	Capture.PNG Views:	0 Size:	45.2 KB ID:	1428155 The Tasmota console shows the MQTT message being sent. I also observed the update on the Association tab of mcsMQTT.

          Code:
          22:03:46 MQT: GreenhouseEnergy/STATUS = {"Status":{"Module":62,"FriendlyName":["GreenhouseEnergy"],"Topic":"GreenhouseEnergy","ButtonTopic":"0","Power":1,"Pow erOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"Switch Topic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRe tain":0}}
          To get the state information the STATE command rather than the STATUS command is used.

          Code:
          22:25:16 MQT: GreenhouseEnergy/RESULT = {"Time":"2020-10-23T22:25:16","Uptime":"1T16:45:55","Vcc":3.462,"SleepMode":" Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":2 ,"SSId":"Dlink1522","BSSId":"D8:FE:E3:7F:8D:F4","Channel":2, "RSSI":32}}
          I tried the SENSOR command and it did not recognize it. This should be the one that reports the various energy readings. It may be that Tasmota rule need to be setup to do this. I can look into this later.

          Comment


            #20
            Originally posted by Michael McSharry View Post
            I tried the SENSOR command and it did not recognize it. This should be the one that reports the various energy readings. It may be that Tasmota rule need to be setup to do this. I can look into this later.
            Yes, SENSOR is not recognized. I tried hundreds of lines, based on LOG file readings, but none would pull the readings out of the device. If you can think of something would be great !!!

            Thank you very much.

            Br,
            Dali

            Comment


              #21
              Let us take a step back and understand why you want to poll. Polling is normally done because the widget being polling does not raise events of interest. In Tasmota's case it can raise pretty much any event you want. What is it that you are going to poll and then what are you going to do with the polled result?

              Comment


                #22
                Hi.

                Minimum log time for this particular device is 10sec. That's not even close to real time.

                I was thinking to create a rule and pool it every second.

                Or to create a rule.
                When device changes from ON/OFF or OFF/ON
                wait for 1 sec
                Pool the device.

                That means I would have correct values 1 sec (not 10) after that change.

                I hope that does make sense.

                Br,
                Dali

                Comment


                  #23
                  So you want energy values with 1 second resolution. What are you doing to do with the energy value that needs this resolution?

                  Comment


                    #24
                    Yes. I need to see the result as it happens. Not 10 sec later.

                    I use it to monitor primary devices to turn off secondary devices when the power gets close to the limit. It's to avoid the overloading the given amount of Energy, else the provider will shut down the supply. We have 25Amp per phase. It needs to be realtime as it is in Z-wave.

                    I'm yet waiting for other TASMOTA devices. How's with others? Do they have lower logging resolution than 10sec?

                    Thank you

                    Br,
                    Dali


                    Comment


                      #25
                      All Tasmota devices will be similar.\

                      Why do you need HS to evaluate the energy use. Why not let Tasmota evaluate it and send HS a message when a programmable threshold is reached?

                      I also challenge the premise that you cannot make a decision based upon data that it 10 seconds old. You know what the rate of change is so you can project into the future what is will be 5 seconds, 2 seconds, or 1 second into the future.

                      Comment


                        #26
                        Originally posted by Michael McSharry View Post
                        All Tasmota devices will be similar.\

                        Why do you need HS to evaluate the energy use. Why not let Tasmota evaluate it and send HS a message when a programmable threshold is reached?
                        I tried this the moment I got the device working, but it did not update the values at all. That's why I started to think about alternatives. Maybe it's just a nature of this device. Maybe others will be better. It's just strange it can not be pulled when needed. I hope others can.


                        However the device admin GUI is accurate totally. Bellow 1sec resolution. Commands just don't go further to MQTT. Why is that so?


                        Click image for larger version

Name:	2020-10-24_031156.jpg
Views:	109
Size:	100.4 KB
ID:	1428192



                        Thank you

                        Br,
                        Dali

                        Comment


                          #27
                          I did some more testing now. Device will send data to Tasmodo Web GUI accurate and instantly, but not further to MQTT when the Voltage, Current, power changes for any amount. Some Z-wave devices (Aeotec heavy duty switch and power meter) have setting in percentage before the data is sent to the controller. For this device the threshold for sending data doesn't seem to exist. All there is is LOG interwall that in minimum to 10sec.

                          Maybe it's just this device I should get Shelly devices very soon.

                          Thank you very much for your help!!!

                          Br,
                          Dali

                          Comment


                            #28
                            There is a link budget that you need to manage. You are consuming bandwidth when you communicate between two devices. Yes you can communicate information every 100 milliseconds, but you cannot do this for every device in the system. Similarly Tasmota may collect a reading every 50 milliseconds, but why does it not collect a reading every 1 milliseconds? It is a trade off of how CPU resources are to be used. The overall system needs to be designed to accommodate everything that it may need to do.

                            if you want a brute force approach then make a rule to communicate energy value at every change in energy sensor. You will find this floods the WiFi network and the ability of mcsMQTT to process all messages that are being received will likely be exceeded.

                            if energy is being used at 1 watt per second for the past hour then any decision that needs to be made about energy use in the next ten seconds can be done based upon the current rate times 10. I cannot believe your power supplier has the resolution you are trying to manage. It is typical design in high rate systems to estimate a future value and then adjust when the future sample is taken. Aircraft control systems will use this approach, but again power companies do not have the same precision needs that exist in control of aircraft surfaces.

                            Again, if upenergy use needs to be monitored vs a threshold the let the device that is doing the measurement also evaluate the energy going over the threshold and only communicate the event rather than every energy sample reading.


                            Comment


                              #29
                              Do a google search for Tasmota rules cookbook and look for thermostat example where you send the set point via MQTT and the rule controls the thermostat to keep the temperature at the set point. In your case the setpoint is the energy level threshold and the action is likely another MQTT message to indicate the setpoint has been reached. You can dynamically change the setpoint based upon other info that may exist in HS. If your action is to turn off the power then it could be done locally rather than putting HS in the middle with its event.

                              Comment


                                #30
                                I understand you point very well.

                                2.4 GHz WiFi will support up to 450 Mbps or 600 Mbps. I don't think we could flood this so easily even with 100 devices each reporting at 1 sec interval. That would be about 100 lines per second. This really is not much i think.


                                Br,
                                Dali





                                Comment

                                Working...
                                X