Announcement

Collapse
No announcement yet.

mcsMQTT Plugin

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

    #76
    If you want to create a dirt cheap Temp sensing system, consider this as a possibility...

    WeMOS device with a DS18b20 hat, have a look at Aliexpress. You load the tasmota firmware onto the WeMOS and you have a fully functioning Temperature mqtt device.

    Total price for mine are $5AUD for each node. Equally you could make your own like I did, there is ability in the code to add multiple sensors onto the 1-wire if needed.

    If you need any more info dont hesitate to ask, it really is simple.

    Pete
    Attached Files
    HS 2.2.0.11

    Comment


      #77
      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.
      Hi Michael,

      I am trying 3.0.4.4,
      In the log I get:
      Code:
      mcsMQTT	ParseJSON tele/sonoff_caldaia/SENSOR:DS18B20={"Time":"2018-01-09T15:58:37","Switch2":"ON","DS18B20":{"Temperature":54.9},"TempUnit":"C"} Line 0 Length cannot be less than zero. parameter name length
      While on the device view the temperature is shown as 549.

      Do I need to make the change Petez69 recommends and recompile? However I didn't touch that config file at all.

      For the decimal point, I am happy to provide you feedback if you want.

      Comment


        #78
        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?
        Done in 3.0.5.0 http://mcsSprinklers.com/mcsMQTT_3_0_5_0.zip The manual has been updated, but you will find one blank line at the end of the receive topic list and the topic can be entered there and then "A"ccept cliked to create the HS device. Rebuild list to have another blank line. I tried several of the SYS topics and some do not seem to generate data from my Mosquito on RPi.

        While on the device view the temperature is shown as 549.

        Do I need to make the change Petez69 recommends and recompile? However I didn't touch that config file at all.

        For the decimal point, I am happy to provide you feedback if you want.
        What I understand you want mcsMQTT to do is interpret the payload and if regional settings are such that a period is not a decimal delimiter than covert the period to a comma. This can be done. My concern is for devices that publish their data consistent with regional nomenclature such as publishing temperature as 34,5 (local) rather than 34.5 (US). From your experience are all numbers with fractional parts always published with period as the delimiter?
        Attached Files
        Last edited by Michael McSharry; January 9, 2018, 05:18 PM.

        Comment


          #79
          If you want to create a dirt cheap Temp sensing system, consider this as a possibility...

          WeMOS device with a DS18b20 hat, have a look at Aliexpress. You load the tasmota firmware onto the WeMOS and you have a fully functioning Temperature mqtt device.
          This is a fine solution. I do recognize the 1-wire support in Tasmota, but have never tried it. Do you know how many of the 1-wire parts have the software support?

          What I like about the Sonoff vs. WeMOS is the built-in 3.3V power supply and then the case that protects the circuit board. $4.85 USD delivered from China. I have modified most of mine so the relay is a dry contact rather than line voltage switch. I have also modified others so that the relay output screw connector is used as sensor input and the relay not used. Sonoff HW mods are in the manual for these two.

          Next adaption I am going to tinker with is interfacing $2 water alarm/buzzers with the Sonoff. The relay for power control to the alarm and the GPIO14 input for the alarm output. I think it will just be a 3.3v zener and cap to replace the buzzer on the $2 alarm. I have several places I want to deploy a water detector/alarm. I have one Dlink Wifi water sensor that sells for around $60 and in general not too happy with it and it does not integrate well. I have seen units from Xiamoi from around $12 that I think are battery powered with very low consumption and integate with their "proprietary" base unit. I think the base has been hacked for easier HA integration, but in the early stages of looking at it.

          Comment


            #80
            Originally posted by Michael McSharry View Post
            My concern is for devices that publish their data consistent with regional nomenclature such as publishing temperature as 34,5 (local) rather than 34.5 (US). From your experience are all numbers with fractional parts always published with period as the delimiter?
            Unfortunately my experience is limited to Sonoff using the Tasmota f/w only, I can't speak in general.
            I don't know if a different code would present the data with regional settings.
            It would make much more sense if this would be configurable on the module's fw but it's not the case today.

            Thinking out loud,
            perhaps for each subscription, a Regex could be configured to re-format the received payload? A checkbox at the top "Enable Regex" would show or hide this? just my 2 cents :-)

            Comment


              #81
              Hi Michael

              Having a quick look in the drop down menu of tasmota, the devices I recognise are:

              DHT11, AM2301, DS18b20
              I2C sensor SI7021
              LCD display offers I2C SCL & SDA

              I deployed my first Sonoff POW last night with tasmota and mqtt, how cool is that :-) Alexa "turn man cave on" and it turns on the electronics bench :-) Ok on the mods you were doing, I like the sounds of that. I was looking to 3D print a small case for the WeMOS and ds18b20 hat and have a USB connector protrude from the case so it can plug into the back of a USB wall wart to make a temp node.

              I had a 5 pack of sonoff basic units also arrive yesterday so I think I'll experiment with bypassing the relay too...as you said inbuilt power supply makes it easy.

              Your plugin is doing all the heavy lifting and works like an absolute charm.

              Thankyou..Pete
              HS 2.2.0.11

              Comment


                #82
                Originally posted by dopamine View Post
                Hi Michael,

                I am trying 3.0.4.4,
                In the log I get:
                Code:
                mcsMQTT	ParseJSON tele/sonoff_caldaia/SENSOR:DS18B20={"Time":"2018-01-09T15:58:37","Switch2":"ON","DS18B20":{"Temperature":54.9},"TempUnit":"C"} Line 0 Length cannot be less than zero. parameter name length
                While on the device view the temperature is shown as 549.

                Do I need to make the change Petez69 recommends and recompile? However I didn't touch that config file at all.

                For the decimal point, I am happy to provide you feedback if you want.
                Hi doppiaemme

                For a single temp sensor using tasmota, the mqtt message looks wrong. It should have a "," after the temp ie: 54.9,

                This is exactly what I had when I made a change in user_config.h

                Can you please go and look at these two lines and see if they are "rem'd out"

                // 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)
                //#define USE_DS18x20_LEGACY // Optional for more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)

                Pete
                HS 2.2.0.11

                Comment


                  #83
                  Michael

                  This error has crept back in on version 3.0.4.4 I've jsut tried it with 3.0.5.0 and its the same....

                  ParseJSON tele/sonoff-temp/SENSOR:AM2301={"Time":"2018-01-10T00:24:18","AM2301":{"Temperature":34.6,"Humidity":21.0}," TempUnit":"C"} Line 0 Length cannot be less than zero. Parameter name: length

                  Regards..Peter
                  HS 2.2.0.11

                  Comment


                    #84
                    Thanks Pete for the feedback. Odd the parsing error exists as my test payload looks exactly like what you posted. I will look into it.

                    Comment


                      #85
                      Thinking out loud,
                      perhaps for each subscription, a Regex could be configured to re-format the received payload? A checkbox at the top "Enable Regex" would show or hide this? just my 2 cents
                      Regular Expressions transformation provided in 3.0.6.0. When a Topic is Accepted then Pattern and Replacement text boxes become available. If they are left blank then Payload goes directly into Device. If they are populated then the regular expression is applied to payload. The displayed payload on mcsMQTT setup is before regular expression is exercised.

                      The transformation of period to comma with something like pattern = \. and replacement = , are one example. I have also tested removal of suffix from a number so the DeviceValue rather than the DeviceString become populated. Other transformation such as Payload into ON and OFF may be other examples.

                      ParseJSON tele/sonoff-temp/SENSOR:AM2301={"Time":"2018-01-10T00:24:18","AM2301":{"Temperature":34.6,"Humidity":21.0}," TempUnit":"C"} Line 0 Length cannot be less than zero. Parameter name: length
                      Fixed (again) in 3.0.6.0.

                      Comment


                        #86
                        Originally posted by Michael McSharry View Post



                        Fixed (again) in 3.0.6.0.
                        Thankyou Michael, no more errors in the logs from the temp sensing
                        HS 2.2.0.11

                        Comment


                          #87
                          I noticed that I excluded the recently added $SYS topics. I reuploaded 3.0.6.0. May not affect you, but letting you know.

                          Comment


                            #88
                            Originally posted by Michael McSharry View Post
                            I noticed that I excluded the recently added $SYS topics. I reuploaded 3.0.6.0. May not affect you, but letting you know.
                            Thankyou, 3_0_6_0 installed...the log is clean :-)
                            HS 2.2.0.11

                            Comment


                              #89
                              Michael/epimetheus

                              Thanks for the pointer of the $SYS topics....client count now added :-)

                              Pete
                              HS 2.2.0.11

                              Comment


                                #90
                                Originally posted by Michael McSharry View Post
                                Regular Expressions transformation provided in 3.0.6.0. When a Topic is Accepted then Pattern and Replacement text boxes become available. If they are left blank then Payload goes directly into Device. If they are populated then the regular expression is applied to payload. The displayed payload on mcsMQTT setup is before regular expression is exercised.

                                The transformation of period to comma with something like pattern = \. and replacement = , are one example. I have also tested removal of suffix from a number so the DeviceValue rather than the DeviceString become populated. Other transformation such as Payload into ON and OFF may be other examples.

                                Fixed (again) in 3.0.6.0.
                                This was awesome! The regex worked like a charm!! thank you!

                                Comment

                                Working...
                                X