Announcement

Collapse
No announcement yet.

MQTT crashes and restarts when topic received

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

    #31
    I do have a question. If I modify the topic being published from an outside source is there a way to edit the topic inside of mcsMQTT so it matches again? I didn't see way but don't know if I just missed it. That would be useful rather than having to create all new devices and edit everywhere they are used inside of HS3.

    Example, right now the temperature topics start with auto/NUC8i3/... but if the cpu name changes, say to fred, then the information would be published as fred/NUC8i3/... so I'd need to edit the settings in mcsMQTT to match.
    HomeSeer Version: HS3 Standard Edition 3.0.0.548
    Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    Number of Devices: 484 | Number of Events: 776

    Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
    3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
    4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
    3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

    Z-Net version: 1.0.23 for Inclusion Nodes
    SmartStick+: 6.04 (ZDK 6.81.3) on Server

    Comment


      #32
      Wildcard is now supported in the Action triggers so +/NUC8i3 would trigger on either of the topics. I had not thought of allowing multiple topics map into the same HS device. It is something I can look into.

      At this time the two approaches. The first is what you know. The second is by edit of /data/mcsMQTT.db when mcsMQTT is not running. DB Browser for SQLite is what I use as it is quite intuitive. You would edit the Source column of a row to change the subscription topic. You could also use SQL expressions directly on the database to do mass edits. The database is just a file so easy to backup and restore.

      Comment


        #33
        Well, I'm quite happy as I now have temperature monitoring working for my NUC8i3 including getting the drive temperatures.
        Speedfan is what I have used in the past for my Windows computers. I have never had monitoring on Linux machines. xAP is a protocol similar in functionality to MQTT and used by Speedfan.

        What does one need to be able to use what you have developed?

        Comment


          #34
          I'm going to put links together plus post what I've written once I get everything cleanup.

          Basically everything was available from open source although I did make some modifications to some. The one change that took me a bit to figure out was how to get the "sensors" function to output sensor name I could use. When I finally found out how it was done it was sooooo simple that I had a red face because I didn't find it sooner. For anyone that's used lm-sensors before they likely would have figured it out sooner.

          Depending on your computer there can be a lot of information that sensors will display. Lots of it one normally wouldn't need to use inside HS3 but it gets published anyway.

          I really like MQTT now that I've actually started using it. Too bad the manufactures of home automation equipment don't include the protocol in their products. Once setup ones local network carries everything needed to control or monitor everything in the home without having to pass it all through the cloud.

          Requiring the cloud to setup is fine but once up everything in the home should be able to communicate without using the cloud.

          I've actually change my thinking and would be totally open to having all WiFi dimmers instead of Z-Wave dimmers. Also, having WiFi controllers that look like dimmers controlling WiFi or any other lighting would be great. HS has a good platform to start with in the WD200 products. Just change out the Z-Wave chip for a WiFi chip and write the new code and bingo, open is ready to go. The transmission protocol would be MQTT. And one side benefit, NO ROYALTY payments to anyone!!!

          Damn, this would be fun to work on.
          HomeSeer Version: HS3 Standard Edition 3.0.0.548
          Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
          Number of Devices: 484 | Number of Events: 776

          Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
          3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
          4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
          3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

          Z-Net version: 1.0.23 for Inclusion Nodes
          SmartStick+: 6.04 (ZDK 6.81.3) on Server

          Comment


            #35
            Check this out...

            - 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 22.04 / Lenovo Tiny M900 / 32Gb Ram

            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

            Comment


              #36
              Did you notice that wires are directly on the ESP. The Tuya OTA flashing seems to be much easier, for at least as long as the vulnerability exists that allows this flashing. Martin Jerry on Amazon also has a Tuya dimmer that shows up on Lighting Deals often. Don't know if it is the same design as this one. I do not have any uses for dimmer switches so have never pursued the product. Leading edge here with a new device type (dimmer) destined to find a home in Tasmota.

              Comment


                #37
                That's interesting although I'd much rather have the features of the WD200 series devices.

                To make it more open one could also have a non-MQTT ability so it would work like the other cloud system out there. The other way to do the cloud interfacing would be to add it to the Broker if someone was not running a full Home Lighting system such as HomeSeer or Smartthings. If running HomeSeer then load a Mosquito Broker on the same box.

                The biggest problem with any WiFi based MQTT system, or any system that wants to go commercial, is the initial WiFi setup. Flashing to do setup is not an option for any system that wants to go commercial. People can't be plugging devices into computers into devices set them up. So the only way to go is Bluetooth. It's the same issue that Ring had to deal with and they had to go Bluetooth to solve it. Fortunately there are several combo chips available that will fit the bill nicely so having Bluetooth in the device is not an issue.

                Right now I see only a few companies that might take this on. One is Jasco as they have been building devices for a long time. I think HomeSeer might be able to do it but they can't do it alone. The biggest advantage they have are the features in the WD200 series devices. I think HomeSeer could also do it BUT they would need help. There are people out here that I think would be more than willing to help out.

                I've even thought about ripping a WD200 apart if only go get the board sizes and layout positions for the Switches, LEDs and power terminals so I could experiment with this. I don't know how the inside of the Wx200 is arranged but if the AC circuits are on one board and the Z-Wave, processor and paddle switches are on a second board one might be able to use the existing AC board for both Z-Wave and WiFi based designs. I know that's the way my old Evolve switches are designed.

                Once you get past the hardware issue the rest is fairly easy. One you have a circuit design then the programming can be done and if you use Open Source design much of the required software is already written. WiFi and Bluetooth stacks are available for all of the chip sent as are MQTT stacks. One just needs to add the part that handles the LEDs, dimming and the paddle. The hardest part is getting FCC certification as one could go through several board layouts to pass. This could be a really fun project.
                HomeSeer Version: HS3 Standard Edition 3.0.0.548
                Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                Number of Devices: 484 | Number of Events: 776

                Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                Z-Net version: 1.0.23 for Inclusion Nodes
                SmartStick+: 6.04 (ZDK 6.81.3) on Server

                Comment


                  #38
                  Originally posted by Michael McSharry View Post
                  Wildcard is now supported in the Action triggers so +/NUC8i3 would trigger on either of the topics. I had not thought of allowing multiple topics map into the same HS device. It is something I can look into.

                  At this time the two approaches. The first is what you know. The second is by edit of /data/mcsMQTT.db when mcsMQTT is not running. DB Browser for SQLite is what I use as it is quite intuitive. You would edit the Source column of a row to change the subscription topic. You could also use SQL expressions directly on the database to do mass edits. The database is just a file so easy to backup and restore.
                  Yuck, I hate editing databases. I'd always rather have an edit button, with warnings, for editing the topics. However it is what it is and I'll work with it.

                  Is DB Browser already loaded someplace and if not where does one get it?

                  Found the site. I assume I could load the browser on another system and edit a copy of the mcsMQTT.db file then put it back?
                  HomeSeer Version: HS3 Standard Edition 3.0.0.548
                  Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                  Number of Devices: 484 | Number of Events: 776

                  Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                  3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                  4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                  3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                  Z-Net version: 1.0.23 for Inclusion Nodes
                  SmartStick+: 6.04 (ZDK 6.81.3) on Server

                  Comment


                    #39
                    I do my own work on Windows and WINSCP the files to-from Linux machines. It is more like working with excel than with Access or other database. They made a nice UI for the novice that only needs minor edits.

                    Comment


                      #40
                      I use Linux desktops these days and SFTP in the explorer window and whatever DB editor is out there in internetlandia ...works well..rarely edit Homeseer DB's these days.
                      - 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 22.04 / Lenovo Tiny M900 / 32Gb Ram

                      HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                      HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                      Comment


                        #41
                        I realized that I missed one way to setup WiFi devices without the need to flash or use BlueTooth. That's by having a way to force the device to disconnect from the local WiFi network, if it's connected, then connect to a device by looking to a specific name. It's basically the way that many dash cams have you connect to them.

                        So, when one flashes devices with the Tasmota software can you still use this method to connect and configure them? Do you use the eWeLink software or something else? If this information is here on the forums please point me to it.

                        Also, has any of the manufactures ever been contacted about including MQTT in their products since it is an approved IoT communication protocol?
                        HomeSeer Version: HS3 Standard Edition 3.0.0.548
                        Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                        Number of Devices: 484 | Number of Events: 776

                        Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                        3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                        4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                        3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                        Z-Net version: 1.0.23 for Inclusion Nodes
                        SmartStick+: 6.04 (ZDK 6.81.3) on Server

                        Comment


                          #42
                          The only one I know that comes with MQTT from the factory is Shelly https://shelly-api-docs.shelly.cloud/#settings-login. They make it convenient to reflash with other firmware too.

                          The factory firmware in most Sonoff devices, and likely others, provides a WiFi method to update firmware. The program SonOTA.exe https://github.com/mirko/SonOTA/releases implements the protocol used by Sonoff/eWeLink to allow update of alternate firmware vs. the latest version from the factory. There was a short period of time last year where Sonoff version 1.6 was shipped and it broke this update. Version 1.5 and now version 2.x continue to support it.

                          The problem spot for many on SonOTA.exe is that they forget to disable fully all their firewalls and the update fails in its final stage in this case. There are YouTube videos on flashing with SonOTA.exe.

                          eWeLink is never used when flashing alternate firmware. If I remember correctly, a factory Sonoff will setup its own SSID and expect the smartphone or similar device to connect to this network. The next step is then use a browser to tell the Sonoff what your network SSID and password is so it configures itself to use this SSID rather than its own. Rather than a browser it may be eWeLink that is used to configure the Sonoff. Again, this is normal use of Sonoff and not the approach to flashing new firmware.

                          Comment


                            #43
                            Here went to using Espurna firmware on my modded SonOff WiFi basics and MagicHome Controllers. You need to JTAG initially to upload the firmware and from there it is a plug n play configuration all via the web browser interface and you can configure the device to have a static IP.ith

                            Been tinkering here with Home Assistant,, Domoticz, Smarthings et al. That and continues to play well with mcsMQTT.

                            I do use smartphones (tinker, root and cook smartphones) and only remote control used is via VPN on the smart phone. No remote smartphone cloud connections used today. Actually do not really utilize any smartphone automation and remote based in the cloud (probably never will). Hoping that a linux based smartphone comes to being.

                            Click image for larger version  Name:	1-wire.jpg Views:	1 Size:	57.2 KB ID:	1283372

                            Click image for larger version  Name:	espurna.jpg Views:	1 Size:	73.0 KB ID:	1283371

                            The modded MagicHome controller pictured is using Espurna plus a hardware add of a digital pot which turns on and off the device plus is a brightness controller. Here using the device for the kitchen counter single color LED lamps.

                            Click image for larger version  Name:	MagicHome.jpg Views:	1 Size:	87.8 KB ID:	1283382
                            - 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 22.04 / Lenovo Tiny M900 / 32Gb Ram

                            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                            Comment


                              #44
                              You need to JTAG initially to upload the firmware and from there it is a plug n play configuration all via the web browser interface and you can configure the device to have a static IP
                              I have toggled back and forth between ESPurna and Tasmota using the OTA capability of both. One should be able to start with SonOTA.exe with a factory device to load a simple Tasmota and then use Tasmota/ESPurna OTA to load whatever version one wants.

                              I do admit that JTAG is faster for me and sometimes I have difficulty with SonOTA.

                              Comment


                                #45
                                Here switched over to using esptool.py to upload firmware or erase rom via Linux command line. Works 100% of the time via JTAG.

                                Easy install...
                                pip install esptool

                                esptool.py --port [serial-port-of-ESP8266] write_flash -fm [mode] -fs [size] 0x00000 [nodemcu-firmware] .bin

                                For using Espurna firmware you just upload the firmware bin. Reboot. The device comes up in AP mode and not configured.

                                I program the WiFi device while still plugged in to the USB port via 5VDC.
                                - 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 22.04 / Lenovo Tiny M900 / 32Gb Ram

                                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                                Comment

                                Working...
                                X