Announcement

Collapse
No announcement yet.

mcsMQTT Plugin

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #61
    I had protected the payload, but had not considered the topic with quotes. Should be fixed in 3.0.4.2.

    Comment


      #62
      Originally posted by qwiksilver96 View Post
      The IP I referred to is for the plugin connection to the HS3 instance upon plugin startup. Once that connection is live, then the plugin connects to the MQTT Broker.

      Best,
      Frank
      No problems Frank. I've not seen this, I grabbed Michael's zip file and moved the files to the directory and then started the plugin....

      Must say after getting this working I'm hooked on mqtt devices....

      Pete
      HS 2.2.0.11

      Comment


        #63
        Hi,

        i've been following this thread and finally tried this plugin...
        I have to say that it's becoming very powerful! Kudos to the author!


        When I added a Sonoff temperature sensor I have the same parsing issue someone else had in this thread:



        is there a way to remove the bracket?
        The original message is:
        Code:
        Info: Received MQTT topic: tele/sonoff_caldaia/SENSOR payload: {"Time":"2018-01-07T17:38:49","Switch2":"ON","DS18B20":{"Temperature":45.3},"TempUnit":"C"}
        I'm running 3.0.4.2

        And also, the decimal point is shown as ".", any idea of an easy way to change it to "," ?
        Using the other MQTT plugin, I made a script that read the whole string, trims out the XX.X and transform to XX,X.
        Not the best way to do it but it worked.

        Comment


          #64
          In other plugins I tried to determine regional settings for comma vs period to handle things properly. I will look to see what I implemented for mcsMQTT. If I have the provisions then I will need you help with some test code to properly detect and handle it.

          I thought I had the parsing working fine with the latest, but will look into it for the following. The prior problem with an actual parsing error and in this case it looks to be the closing } is included as JSON content.

          Code:
          {"Time":"2018-01-07T17:38:49","Switch2":"ON","DS18B20":{"Temperature":45.3},"TempUnit":"C"}

          Comment


            #65
            Parsing corrected again in 3.0.4.3. Still working with HST to get the plugin in the updater. The original is there now, but these updates are not yet showing up. http://mcsSprinklers.com/mcsMQTT_3_0_4_3.zip

            For the comma vs. period we need to look at what is happening as DeviceValue is being updated. In the example with the parsing error the item was not numeric so it was stored in DeviceString. With the updated version look at Device Management page and see what is actually stored in the Value and see how HS3 converts it to Status for display.

            Comment


              #66
              Originally posted by doppiaemme View Post
              Hi,

              i've been following this thread and finally tried this plugin...
              I have to say that it's becoming very powerful! Kudos to the author!


              When I added a Sonoff temperature sensor I have the same parsing issue someone else had in this thread:



              is there a way to remove the bracket?
              The original message is:
              Code:
              Info: Received MQTT topic: tele/sonoff_caldaia/SENSOR payload: {"Time":"2018-01-07T17:38:49","Switch2":"ON","DS18B20":{"Temperature":45.3},"TempUnit":"C"}
              I'm running 3.0.4.2

              And also, the decimal point is shown as ".", any idea of an easy way to change it to "," ?
              Using the other MQTT plugin, I made a script that read the whole string, trims out the XX.X and transform to XX,X.
              Not the best way to do it but it worked.
              Hi there....ok, it sounds like you have a single DS18B20 sensor and uncommented a "define" statement that is required for MULTIPLE sensors.

              // WARNING: Select none for default one DS18B20 sensor or enable one of the following two options for multiple sensors
              //#define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)

              You need to go back into the user_config.h file and put a // infront of the define. Compile it and you can do an OTA upgrade and it will be sorted :-)

              If you want different delimiters you will need to experiment in the Tasmota code to find where the mqtt message is created

              Pete
              HS 2.2.0.11

              Comment


                #67
                Maybe I've missed it, but is there a way with this plugin to specify a topic to receive and create a device for it if it's not in the list on the plugin config page? I'm switching over from the other MQTT plugin and I have devices for the number of broker connections and subscriptions to use as diagnostic tools ($SYS/broker/clients/connected and $SYS/broker/subscriptions/count). These topics don't appear in the list but are published when I subscribe to them with other clients.

                Comment


                  #68
                  The plugin subscribes to Topic template # so everything the broker sees should also be visible to the plugin. Do you know why they may not be visible? Could it be that the Topic has not been published since the plugin was activated?

                  To answer you question explicitly, there is no provision to receive a Topic that has not been previously published. I can add it, but first need to understand the need. There is a means to publish Topic that are not associated with existing received or existing HS3 devices. While it is available, I do not see where many will use it.

                  Comment


                    #69
                    Originally posted by doppiaemme View Post

                    is there a way to remove the bracket?
                    The original message is:
                    Code:
                    Info: Received MQTT topic: tele/sonoff_caldaia/SENSOR payload: {"Time":"2018-01-07T17:38:49","Switch2":"ON","DS18B20":{"Temperature":45.3},"TempUnit":"C"}
                    Here is the message you will get afterwards:

                    {"Time":"2018-01-08T08:49:51","AM2301":{"Temperature":44.6,"Humidity":5.0},"T empUnit":"C"}
                    HS 2.2.0.11

                    Comment


                      #70
                      Hi Michael

                      That last update broke the temp/humidity value. Example message sent from broker to mcs_mqtt

                      {"Time":"2018-01-08T08:49:51","AM2301":{"Temperature":44.6,"Humidity":5.0},"T empUnit":"C"}

                      The humidity value is set to 5.0}

                      I've rolled back to the previous version and its fine...ie: 5.0

                      Cheers..Pete
                      HS 2.2.0.11

                      Comment


                        #71
                        Michael,

                        Here have created a 1-wire hub in the attic for the second floor temperature and humidity sensors.

                        Currently using both Digitemp and OWFS on an RPi in the attic. Digitemp creates a CSV file which is on a shared drive on the HS3 Linux mothership.

                        A VB script runs every 5 minutes which reads the values and creates dynamic variables.

                        Only thing is that the script is statically configured per 1-wire device reads. IE: adding a sensor is not a dynamic thing.

                        What would be the best or easiest methodology to broadcast these values with MQTT using OWFS or Digitemp?

                        I see a few python scripts that do this out there in internetlandia.

                        Here is one that I am looking at: mqtt-owfs-temp
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                        HS4 Lite - Ubuntu 20.04 / VB W7e Jetway JBC420U591
                        Fanless IntelĀ® Celeron N3160 SoC 8Gb
                        HS4 Pro - V4.1.18.1 - Ubuntu 20.04/VB W7e 64 bit Intel Kaby Lake CPU - 32Gb
                        HSTouch on Intel tabletop tablets

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

                        Comment


                          #72
                          That last update broke the temp/humidity value. Example message sent from broker to mcs_mqtt

                          {"Time":"2018-01-08T08:49:51","AM2301":{"Temperature":44.6,"Humidity":5.0},"T empUnit":"C"}

                          The humidity value is set to 5.0}
                          Took a deeper look and more thorough test. Update in 3.0.4.4 http://mcsSprinklers.com/mcsMQTT_3_0_4_4.zip


                          What would be the best or easiest methodology to broadcast these values with MQTT using OWFS or Digitemp?
                          I have not ventured from the .NET connector for mono and the ESP8266 contained in the Sonoff units. I know 1-wire is supported by the Tasmota software that is installed on the Sonoff, but never tried to understand details. MQTT is part of Tasmota as well as several Aurdino-class products. It may even be possible to get the MQTT libraries from Tasmota or similiar for repurposing. Sorry I cannot be much help, but my breadth of usage is not large.

                          Comment


                            #73
                            Originally posted by Michael McSharry View Post
                            Took a deeper look and more thorough test. Update in 3.0.4.4 http://mcsSprinklers.com/mcsMQTT_3_0_4_4.zip




                            I have not ventured from the .NET connector for mono and the ESP8266 contained in the Sonoff units. I know 1-wire is supported by the Tasmota software that is installed on the Sonoff, but never tried to understand details. MQTT is part of Tasmota as well as several Aurdino-class products. It may even be possible to get the MQTT libraries from Tasmota or similiar for repurposing. Sorry I cannot be much help, but my breadth of usage is not large.
                            Michael, thats fixed, thankyou....all sensors that have either temp or temp/humidity are working fine....all of the devices are running Tasmota firmware on either Sonoff or WeMOS/Nodemcu boards. Again all based on ESP8266 devices.

                            The WeMOS/Nodemcu configurations are extremely handy as you couple them with a DS18b20 or am2301 temp/humid sensor and they are a temp node. Cost is less than $5...

                            Cheers & thanks

                            Pete
                            HS 2.2.0.11

                            Comment


                              #74
                              Originally posted by Pete View Post
                              Michael,

                              Here have created a 1-wire hub in the attic for the second floor temperature and humidity sensors.

                              Currently using both Digitemp and OWFS on an RPi in the attic. Digitemp creates a CSV file which is on a shared drive on the HS3 Linux mothership.

                              A VB script runs every 5 minutes which reads the values and creates dynamic variables.

                              Only thing is that the script is statically configured per 1-wire device reads. IE: adding a sensor is not a dynamic thing.

                              What would be the best or easiest methodology to broadcast these values with MQTT using OWFS or Digitemp?

                              I see a few python scripts that do this out there in internetlandia.

                              Here is one that I am looking at: mqtt-owfs-temp
                              If you want an easy way to get from a rpi into mqtt for your one wire hub, check out Node Red. It's got a couple of OWFS nodes and is a fairly easy and lightweight way to convert protocols. I've got 3 RPI3's and 3 RPIZW's running it with a variety of sensors. They're mostly talking mqtt back to HS.

                              Sent from my SM-N950U using Tapatalk

                              Comment


                                #75
                                Originally posted by Michael McSharry View Post
                                The plugin subscribes to Topic template # so everything the broker sees should also be visible to the plugin. Do you know why they may not be visible? Could it be that the Topic has not been published since the plugin was activated?

                                To answer you question explicitly, there is no provision to receive a Topic that has not been previously published. I can add it, but first need to understand the need. There is a means to publish Topic that are not associated with existing received or existing HS3 devices. While it is available, I do not see where many will use it.
                                Here are a couple of links on the topics in looking for.

                                https://mosquitto.org/man/mosquitto-8.html

                                https://github.com/mqtt/mqtt.github.io/wiki/SYS-Topics

                                https://www.hivemq.com/blog/mqtt-ess...best-practices

                                These don't appear in a subscription to #, and have to be subscribed to directly. Is it possible to add the ability to subscribe to a topic blindly, even if it hasn't already been published?

                                Sent from my SM-N950U using Tapatalk

                                Comment

                                Working...
                                X