Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved
Collapse
Discussion Forum to share and further the development of home control and automation, independent of platforms.
B

Buxton

@Buxton
Possible feature request?
CatmanV2C
No idea how easy this would be. During my migration away from Z-wave I've been replacing the Z-wave devices with Sonoff which has broken some of my automations. Any chance of a 'Test Reaction' function to call out which ones are broken because an entity no longer exists? Without actually running the reaction? Or does this exist already and I'm just not aware of how to do it? Obviously I can see entities that are no longer available, but not quite what I'm looking for. I guess it's something of an edge case so no huge issue. TIA! C
Multi-System Reactor
Copying a global reaction
tunnusT
With build 25328, if you copy a global reaction, a new reaction does not appear in the UI unless you do a refresh. I recall this used to work without needing this page refresh? Anyway, only a minor nuisance.
Multi-System Reactor
Logic Assistance: Exterior Lights on when Illuminance Below Threshold
PablaP
Topic thumbnail image
Multi-System Reactor
Time series documentation
tunnusT
Is the current manual (incl. examples) up to date with how retention value is handled in time series configuration? Referring to this post
Multi-System Reactor
Genuinely impressed with Zigbee and HA / Reactor
CatmanV2C
Just for the record, in case anyone is following, I'm really rather impressed. I have installed one of these: https://www.amazon.co.uk/dp/B0B6P22YJC?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 That's connected (physically) to the VM running on my Synology, with a 2m USB extension. The same host also runs Openluup, Mosquito, HA Bridge. Yesterday I installed Zigbee2mqtt. That was a bit of a PITA but mostly because of ports and permissions. Once up and running, and the correct boxes ticked, immediately visible in Home Assistant via the MQTT integration, and thence into Reactor I've only got two devices. I bought the cheapest sensor I could find, which is a door sensor. Dead easy to add to ZIgbee2mqtt and again, immediately visible in HA. https://www.amazon.co.uk/dp/B0FPQLWRW1?ref=ppx_yo2ov_dt_b_fed_asin_title The dongle is on the top floor of the house, and I wanted the sensor on the back door (just about as far apart as it's possible to get short of going into the garage) When I moved the sensor downstairs it dropped out pretty instantly (which wasn't a huge surprise) so quick bit of research found out that smart plugs will act as routers so... https://www.amazon.co.uk/dp/B0FDQDPGBB?ref=ppx_yo2ov_dt_b_fed_asin_title Took me about 30 seconds to connect. Updated the name. Instantly visible in Reactor with the new name pushed over from Zigbee2mqtt. And lo, the door sensor now has a signal of 140 and works as far as I can tell perfectly and instantly (unlike my z-wave one). A few more of those will be purchased and used to replace the Tuya wifi cloud devices and the (continually failing) Z-wave plugs (yeah, they were TKB so....) Commended to the house. Thanks for everyone that got me on the right lines. C
Zigbee
Tuya Wifi to Tasmota flashing
CatmanV2C
Just popping this in here in case it's helpful to anyone else later. I've got several Tuya Wifi sockets that I'm getting rid of / replacing. Looking at which ones, if any, can be flashed to Tasmota: https://www.amazon.co.uk/dp/B09Y212TCK?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 Are NOT flashable C
Zigbee
MQTT templates for ZIgbee scene controller, or a better way?
CatmanV2C
Topic thumbnail image
Multi-System Reactor
Reset a delay
CatmanV2C
I'm sure this has been asked, and answered, but damned if I can figure it out Use case: I have a rear garden with lights. A door from the kitchen into the garden and a door from the garage. Currently if I open the kitchen door the lights come on (yay) and a 3 minute delay starts. After 3 minutes, no matter what else happens, the lights go off (Boo! But also yay!) What I would like is for the 3 minute delay until the lights go off to start from the latest door open event. That is, if I'm going from kitchen to garage, and back again, the lights stay on until there's three minutes of no activity. I've tried 'hacking' with a virtual switch, but can't seem to stop the delay. Any pointers? TIA C
Multi-System Reactor
Zigbee2mqtt installed! sytemctl not happy :(
CatmanV2C
Hello oh great ones. After a couple of hours messing with ports and permissions I have Zigbee2mqtt installed and running on my virtual pi Can connect to the front end and everything Odd one though, simply cannot get systemctl to work and the error is, well, unhelpful. The service file is this: [Unit] Description=zigbee2mqtt After=network.target [Service] Environment=NODE_ENV=production Type=notify ExecStart=/usr/local/bin/node index.js WorkingDirectory=/opt/zigbee2mqtt StandardOutput=inherit # Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5) StandardError=inherit WatchdogSec=10s Restart=always RestartSec=10s User=pi [Install] WantedBy=multi-user.target Straight out of the docs with the change to point to my local node install (which we know works as it's the same as the very fine Reactor is using. Running manually pnpm start in /opt/zigbee2mqtt works fine However: catman@openluup:/etc/systemd/system$ sudo systemctl start zigbee2mqtt.service Job for zigbee2mqtt.service failed because the control process exited with error code. See "systemctl status zigbee2mqtt.service" and "journalctl -xe" for details. Which I have catman@openluup:/etc/systemd/system$ sudo systemctl status zigbee2mqtt.service ● zigbee2mqtt.service - zigbee2mqtt Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; disabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Tue 2025-12-16 12:32:42 GMT; 4s ago Process: 3093 ExecStart=/usr/local/bin/node index.js (code=exited, status=217/USER) Main PID: 3093 (code=exited, status=217/USER) and -- A start job for unit zigbee2mqtt.service has begun execution. -- -- The job identifier is 17477. Dec 16 12:35:16 openluup systemd[3178]: zigbee2mqtt.service: Failed to determine user credentials: No such process Dec 16 12:35:16 openluup systemd[3178]: zigbee2mqtt.service: Failed at step USER spawning /usr/local/bin/node: No such process -- Subject: Process /usr/local/bin/node could not be executed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The process /usr/local/bin/node could not be executed and failed. -- -- The error number returned by this process is ERRNO. Dec 16 12:35:16 openluup systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=217/USER -- Subject: Unit process exited -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- An ExecStart= process belonging to unit zigbee2mqtt.service has exited. -- -- The process' exit code is 'exited' and its exit status is 217. Dec 16 12:35:16 openluup systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The unit zigbee2mqtt.service has entered the 'failed' state with result 'exit-code'. Dec 16 12:35:16 openluup systemd[1]: Failed to start zigbee2mqtt. -- Subject: A start job for unit zigbee2mqtt.service has failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- A start job for unit zigbee2mqtt.service has finished with a failure. Which strikes me as very odd. Any blindingly obvious things I'm missing? TIA! C
Zigbee
Any thoughts on which is better
CatmanV2C
Obviously a quiet forum, but perhaps it's time I'm looking at rolling Zigbee into my system, in large part for the Aqara FP300 presence sensors which seem to finally provide a solution to if the wasp is actually in the box. My current set up is as follows: One Debian VM on Synology NAS running: Z-wave Server Open Luup Multi system reactor HA bridge Mosquito MQQT broker This machine has a UZB Z-wave stick connected via the USB port on the NAS Another HAOS VM on the same NAS running HAOS I've got some older Z-wave stuff that I keep around until it fails. I have some Tuya stuff integrated in HA My thought was to get either a SMLIGHT SLZB-06M or an Aqara Hub M2 Integrate them via Zigbee2MQQT (running on the Debian machine) and then expose them in HA so I can continue to automate in MSR. Thoughts on which of those devices wold be preferable long term. Both are POE capable which is good. It also appears I could add a USB dongle to the NAS and expose it to the HAOS machine. Any thoughts from the assembled experts here? TIA C
Zigbee
Single protocol?
CatmanV2C
Another question to the hive mind. Prompted by the fact that I lost yet another z-wave device over the weekend due to a power issue. It looks like z-way server is reporting another device failed (although it's working fine) and message queue is far too long IMHO. Also the failed device has been removed in the expert interface, but still there in the 'normal' one. Sigh. Currently I have z-wave, Tuya, thinking about Zigbee.... Does anyone use one single protocol for everything? Right now I'm feeling that as the z-wave stuff dies, I'm just gonna replace it with something else.... C
General Discussion
HDMI oddness
CatmanV2C
Not really Smart Home stuff, but going to ask as we have smart people... Bear with me on this one. Asking here because of the font of knowledge! For many eek years I have had a Virgin V6 box and a Raspberry Pi running Kodi connected to my TV through a cheap *** HDMI switch. It all worked beautifully but the absolutely critical thing was that the TV remote passed the signals back to the Pi to allow remote control of Kodi. Couple of changes of late: Installed a soundbar on the TV using the ARC (audio return channel). That then turns the soundbar on and off when the TV turns on and off and the TV volume control controls the soundbar volume direct. Everything continues to work Upgraded the software of the Tivo box to Virgin 360. This is literally software only. You get sent a snacky new Bluetooth remote hit 'upgrade' on the screen and off it goes. Now, things are not playing well. Typically when I turn on to watch Kodi the soundbar comes on (as it should) but the TV either puts out sound through its own speakers and the soundbar, or just the soundbar. It's not possible to control the volume of the soundbar through the TV. Also it's not longer possible to control Kodi using the TV remote. If I turn the TV360 box off, i.e. power it down, before turning on to watch Kodi, everything is fine. This makes little to no sense to me. My assumption is that the cheap *** HDMI switch is getting something from the TV360 connection that it didn't used to get when the software was Tivo and that's screwing up the HDMI communications. I'm upgrading the switch to something a little less chap, but wondered if anyone could validate my theory at all? TIA C
General Discussion
Reactor Loading Screen Safari
S
Topic thumbnail image
Multi-System Reactor
Constraints states visually do not match actual
S
Topic thumbnail image
Multi-System Reactor
Oh the joy of pairing
CatmanV2C
When I remember the old days Just added a new Tuya plug (OK so it's cloud) Start to finish, visible in HA and MSR < 30 seconds... C
Vera
Home Assistant Connect ZWA-2 & ZBT-2
therealdbT
Topic thumbnail image
Hardware
[MSR] Feature request: For Each action on arrays/groups
therealdbT
Topic thumbnail image
Multi-System Reactor
[Solved] Error: Command timeout
G
at _ClientAPI._commandTimeout (http://192.168.1.100:8111/client/ClientAPI.js:807:179 Seeing this randomly when returning to open browser tab after being away awhile. Once, maybe twice a day. "What did you do to trigger it?" Literally nothing, just walked away and returned and there it was. Actions taken in reasonably close proximity to this particular instance of it popping up: I'd restarted the MSR container in Portainer. I'll try to grab some logs here shortly.
Multi-System Reactor
Issue with MSR UI becoming unresponsive
S
I'm having an issue with MSR's UI being very unresponsive. It started happening a couple days ago and I didn't make any changes that would have caused this except adding some meross lan devices in HA. When I go into an entity action and use the search functionality, it usually will start filtering and then get to a place after a few letters are entered where it will take 30 seconds or more (sometimes minutes) for the UI to show what I am typing. During this time MSR ui is completely unresponsive. I've tried multiple browsers and multiple computers. HA and MSR are both deployed in docker. I have run HTOP on the host and when the problem happens there are no CPU/Memory spikes at all. From a functionality standpoint MSR is working perfectly. This seems to be an UI issue only. Do i need to ditch Docker and run MSR on a Proxmox VM? I have both stand alone Docker and Proxmox environments. I dont mind doing that I just want to be able to use the UI again... Installation method Home Assistant Container Core 2025.7.3 Frontend 20250702.3 nothing crazy in the logs except some openweather map stuff that doesn't make any sense as it is working fine in MSR Any help would be greatly appreciated Reactor latest-25328-b2ed1365 app 25328 configuration from /var/reactor/config NODE_PATH /opt/reactor:/opt/reactor/node_modules [latest-25328]2025-11-30T20:01:53.843Z <app:null> Reactor build latest-25328-b2ed1365 starting on v24.11.1 /usr/local/bin/node [latest-25328]2025-11-30T20:01:53.844Z <app:null> Process ID 1 user/group 0/0; docker; platform linux/x64 #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025; locale (undefined) [latest-25328]2025-11-30T20:01:53.844Z <app:null> Basedir /opt/reactor; data in /var/reactor/storage [latest-25328]2025-11-30T20:01:53.844Z <app:null> NODE_PATH=/opt/reactor:/opt/reactor/node_modules [latest-25328]2025-11-30T20:01:53.865Z <app:null> Resolved timezone=America/New_York, environment TZ=America/New_York; offset minutes from UTC=-300 [latest-25328]2025-11-30T20:01:53.867Z <default:null> Module i18n v25141 [latest-25328]2025-11-30T20:01:53.867Z <app:null> Configured locale (undefined); selected locale(s) en-US.UTF-8 [latest-25328]2025-11-30T20:01:53.879Z <app:null> Loaded locale en-US for en-US [latest-25328]2025-11-30T20:01:53.879Z <app:null> Local date/time using configured timezone and locale formatting is "11/30/2025, 3:01:53 PM" [latest-25328]2025-11-30T20:01:53.889Z <Structure:null> Module Structure v25326 [latest-25328]2025-11-30T20:01:53.890Z <Capabilities:null> Module Capabilities v24312 [latest-25328]2025-11-30T20:01:53.904Z <Plugin:null> Module Plugin v25141 [latest-25328]2025-11-30T20:01:53.923Z <Timer:null> Module Timer v25279 [latest-25328]2025-11-30T20:01:53.924Z <TimerBroker:null> Module TimerBroker v25314 [latest-25328]2025-11-30T20:01:53.927Z <Entity:null> Module Entity v25251 [latest-25328]2025-11-30T20:01:53.929Z <Controller:null> Module Controller v25253 [latest-25328]2025-11-30T20:01:53.930Z <AlertManager:null> Module AlertManager v25318 [latest-25328]2025-11-30T20:01:53.937Z <default:null> Module Ruleset v25283 [latest-25328]2025-11-30T20:01:53.937Z <default:null> Module Rulesets v25141 [latest-25328]2025-11-30T20:01:53.942Z <GlobalExpression:null> Module GlobalExpression v25258 [latest-25328]2025-11-30T20:01:53.953Z <Predicate:null> Module Predicate v25328 [latest-25328]2025-11-30T20:01:53.956Z <Rule:null> Module Rule v25323 [latest-25328]2025-11-30T20:01:53.958Z <GlobalReaction:null> Module GlobalReaction v25292 [latest-25328]2025-11-30T20:01:53.959Z <Engine:null> Module Engine v25325 [latest-25328]2025-11-30T20:01:53.964Z <httpapi:null> Module httpapi v25328 [latest-25328]2025-11-30T20:01:53.972Z <wsapi:null> Module wsapi v25328 [latest-25328]2025-11-30T20:01:53.994Z <TaskQueue:null> Module TaskQueue 24138 [latest-25328]2025-11-30T20:01:53.994Z <VeraController:null> Module VeraController v25141 [latest-25328]2025-11-30T20:01:54.179Z <HassController:null> Module HassController v25325 [latest-25328]2025-11-30T20:02:13.797Z <OWMWeatherController:null> Module OWMWeatherController v25268 [latest-25328]2025-11-30T20:02:13.800Z <SystemController:null> Module SystemController v25323 [latest-25328]2025-11-30T20:02:13.807Z <MQTTController:null> Module MQTTController v22092 [latest-25328]2025-11-30T20:02:20.630Z <OWMWeatherController:CRIT> FetchError: request to https://api.openweathermap.org/data/2.5/weather?lat=xxxxxxxxxx&lon=-xxxxxxxxx&appid=xxxxxxxxxxxxxxxxxxxxxxxxxx&units=standard&_r=1xxxxxxxxxxxxxxfailed, reason: [-] FetchError: request to https://api.openweathermap.org/data/2.5/weather?lat=xxxxxxxxxxx&lon=-xxxxxxxxxxxxxxxxxx&appid=xxxxxxxxxxxxxxxxxxx&units=standard&_r=xxxxxxxxxxxxxxxfailed, reason: at ClientRequest.<anonymous> (/opt/reactor/node_modules/node-fetch/lib/index.js:1501:11) at ClientRequest.emit (node:events:508:28) at ClientRequest.emit (node:domain:489:12) at emitErrorEvent (node:_http_client:108:11) at TLSSocket.socketErrorListener (node:_http_client:575:5) at TLSSocket.emit (node:events:508:28) at TLSSocket.emit (node:domain:489:12) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at processTicksAndRejections (node:internal/process/task_queues:89:21
Multi-System Reactor
Date/time condition
tunnusT
Topic thumbnail image
Multi-System Reactor
About
Posts
136
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Tinkering with Tasmota sensors
    B Buxton

    @archers Very Cool gadget. I soldered to the flash pins, which given the size of the contacts was challenging, but managed to make it work. Now waiting for my BLE sensors to arrive.
    SonoffDualR3-2.png

    SonoffDualR3.png

    Energy Monitoring built into the dual relay!

    Hardware

  • openLuup: MQTT server
    B Buxton

    @archers

    I was seeing similar network issues and also came to the conclusion that the socket library was most likely at fault. My solution is to use Mosquitto as my main broker, which accepts all MQTT traffic (topic # in 0) with all my MQTT devices pointing to it, and then Mosquitto filters push traffic to openLuup. Below is my config file that displays the filters:

    allow_anonymous true
    password_file /mosquitto/data/PW.txt
    listener 1883
    connection openLuup
    address 127.0.0.1:1882
    topic tele/# out 
    topic stat/# out 
    topic BlueIris/# out 
    topic # in 0
    cleansession false
    notifications true
    username *****
    password *******
    bridge_protocol_version mqttv311
    try_private false
    log_timestamp true
    log_timestamp_format %Y-%m-%d--T_%H:%M:%S
    

    As you can see, Mosquitto runs on the same server as openLuup. It is started by a docker compose file. The config filters eliminated the network errors on openLuup and my openLuup install now runs for days on end without any errors at all. I also have HA running on the same server via docker compose, though I only use it for its Hacs Alexa integration. I pipe my Alexa calls to HA using an HA token and a crude plugin that I wrote. I have not found a use for HA outside of openLuup yet, though there are some interesting integrations I will eventually try out.

    As regards MQTT I don't think you need to worry about network traffic so much as mqtt is an extremely light protocol, at least in so far as compared to cameras and hi-def wireless etc ( I have a bunch of these high bandwidth devices on my network in their own subnets). I have found that the thing that tends to bog down is the lua socket function and as long as you limit its connections, you will probably alleviate most of the network problems.

    Nginx is one of the best web servers available, specializing in load balancing millions of connections, and from what I've read, it is written in Lua. Which suggests that the lua socket module itself is causing the network issues as Nginx most likely rolled their own network library.

    openLuup

  • openLuup: Tasmota MQTT Bridge
    B Buxton

    @akbooer I think I found the culprit causing the random connection disconnects to Mosquitto. The LWT payload for a given device is a simple string, which doesn't seem to decode in the json decode call. So I added the below code to send a json string to the decoder. The errors have disappeared and I now see the LWT variable in the service variables. The variable reads "LWT : Online"

    --line 165
    local valid = {SENSOR = true, STATE = true, RESULT = true, LWT = true}
    
    --line 172
      -- begin code
      local info, err = json.decode (message)
       
      if message then
    	if not info then  -- json did not decode because of single string parameter
    		message = '{' .. '"' .. mtype .. '"' .. ':' .. '"' .. message .. '"' .. '}'
    	end
      end
      -- end code
    
      
      local info, err = json.decode (message)  
    

    This is probably not the way you would handle the error, but it does work.

    Plugins

  • MQTT – setup and use
    B Buxton

    @akbooer Tasmota energy sensor

    {
      "Time": "2021-03-28T21:51:01",
      "ENERGY": {
        "TotalStartTime": "2020-06-07T00:10:43",
        "Total": 2356.063,
        "Yesterday": 7.056,
        "Today": 6.459,
        "Period": 24,
        "Power": 285,
        "ApparentPower": 302,
        "ReactivePower": 99,
        "Factor": 0.95,
        "Voltage": 123,
        "Current": 2.453
      }
    }
    
    General Discussion

  • openLuup: MQTT server
    B Buxton

    No, you can still configure UDP. You just need login credentials now.

    If I have a few moments, I will try to set up one of my Pi machines this weekend with an instance of Mosquitto. My HA server that runs my docker Mosquitto is headless, and I run Ubuntu server, so command line captures of packets are just a drag. My Pi has an hdmi port so I should be able to load the gui version of wireshark, and then test/capture the traffic between the two instances. I will let you know.

    openLuup

  • MQTT Plugin
    B Buxton

    @rafale77 hey Rafale,

    I went down the very same road a while back and threw in towel because the polling by the MQTT plugin created CPU drags that stopped openLuup from functioning "reliably". The instability was also in part because I use two other must-have plugins that rely on polling, and I imagine that the combination of the three was creating a scenario that caused intermittent failures. And I too ended up implementing MQTT in Home Assistant and then using RealDB's virtual HTTP plugin to send commands to my WiFi devices--albeit not knowing the status of the devices in openLuup after the send.

    I'm looking at RigPapa's socket proxy and WebSocket plugins to see if I can transform my polling plugins to Async. The MQTT plugin is too complex for me to convert though, so if you take a crack at it, and are successful, I would very much appreciate you publishing your results, as MQTT is becoming a must for me.

    GitHub - toggledbits/sockproxyd: A socket proxy for Vera/openLuup systems

    GitHub - toggledbits/sockproxyd: A socket proxy for Vera/openLuup systems

    A socket proxy for Vera/openLuup systems. Contribute to toggledbits/sockproxyd development by creating an account on GitHub.

    GitHub - toggledbits/LuWS: A WebSocket client implementation for Luup (Vera and openLuup) systems, with optional async receive (responsive)

    GitHub - toggledbits/LuWS: A WebSocket client implementation for Luup (Vera and openLuup) systems, with optional async receive (responsive)

    A WebSocket client implementation for Luup (Vera and openLuup) systems, with optional async receive (responsive) - toggledbits/LuWS

    Plugins

  • MQTT – setup and use
    B Buxton

    @akbooer I hate to add more to the pile... but I'm still seeing a receive error for the connection to mosquitto. openLuup 2021.04.29b

    Here's the log error:

    2021-05-01 14:22:38.815   openLuup.io.server:: MQTT:1882 connection closed  tcp{client}: 0x5579919e9c58
    2021-05-01 14:22:38.816   openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x5579919e9c58
    2021-05-01 14:22:43.935   luup.io.incoming:: bytes received: 51, status: OK tcp{client}: 0x557990e7f528
    2021-05-01 14:22:48.435   luup.io.incoming:: bytes received: 51, status: OK tcp{client}: 0x557990e7f528
    2021-05-01 14:22:49.763   luup.variable_set:: 10181.urn:micasaverde-com:serviceId:EnergyMetering1.KWHReading was: 1619904116 now: 1619904168 #hooks:0
    2021-05-01 14:22:50.158   openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x557991971ff8
    2021-05-01 14:22:53.834   openLuup.io.server:: MQTT:1882 connection from 127.0.0.1 tcp{client}: 0x5579920dc0b8
    2021-05-01 14:22:53.834   openLuup.mqtt:: client is in ERROR empty
    2021-05-01 14:22:53.834   openLuup.mqtt:: credentials is in ERROR empty
    2021-05-01 14:22:53.834   openLuup.mqtt:: subscriptions is in ERROR empty
    

    using the below error trapping in function "MQTTservlet"

      local function MQTTservlet (client)
      
    	if client == nil then
    	  _log ("client is in ERROR nil")
    	else
    	  	if table.concat(client) == "" then
    		_log ("client is in ERROR empty")
    		else
    	   _log (table.concat {"MQTT ERROR: ", table.concat(client)})
    	    end
    	end 
    	
    	if credentials == nil then
    	  _log ("credentials is in ERROR nil")
    	else
    	  	if table.concat(credentials) == "" then
    		_log ("credentials is in ERROR empty")
    		else
    	   _log (table.concat {"MQTT ERROR: ", table.concat(credentials)})
    	    end
    	end 
    	
    	if subscriptions == nil then
    	  _log ("subscriptions is in ERROR nil")
    	else
    	  	if table.concat(subscriptions) == "" then
    		_log ("subscriptions is in ERROR empty")
    		else
    	    _log (table.concat {"MQTT ERROR: ", table.concat(subscriptions)})
    	    end
    	end
    	
        return function () incoming (client, credentials, subscriptions) end
      end
    

    I can't find a deeper layer in the stack where I can trap for the incoming message to see what's in the message that is throwing the error. As near as I can tell, if openLuup tries to connect to a running mosquitto instance, then it fails to see the topics and messages, and passes empty--but not nil--strings when the servlet interface sees incoming bytes.

    If I restart mosquitto, openLuup then sees the topics and messages and the error messages stop--and the connection to mosquitto remains stable.

    This behavior does not occur when I aim an IOT device directly at openLuup--in that the connection to the device always resumes when openLuup reloads--in other words, I don't need to restart the IOT device to enable the connection.

    General Discussion

  • openLuup: MQTT server
    B Buxton

    @akbooer Below is the relevant output of a typical packet between mosquitto and a mosquitto bridged instance. In this case, mosquitto is sending update data to the bridge regarding a tasmota device/switch I use to remotely reboot my Vera. The format is definitely MQTT 3.1 and not 5.0, as 5.0 would not parse correctly in the wireshark viewer. The data payload is at the top of the window as Wireshark will truncate long messages. I can PM you the entire capture as it's not much, but may contain technical info that's best kept private. Let me know.

    I'll try to capture some traffic between openLuup and mosquitto later.

    {"Version":"9.1.0(tasmota)","BuildDateTime":"2020-11-07T11:57:45","Module or Template":"Gosund-WP5","RestartReason":"Software/System restart","Uptime":"6T05:50:22","Hostname":"power_MainVera-0278","IPAddress":"10.17.2.33","RSSI":"100","Signal (dBm)":"-17","WiFi LinkCount":5,"WiFi Downtime":"0T00:00:10","MqttCount":14,"LoadAvg":19}
    
    
    
    Frame 9: 433 bytes on wire (3464 bits), 433 bytes captured (3464 bits) on interface eth0, id 0
    Ethernet II, Src: Advansus_0a:8c:3a (00:19:0f:0a:8c:3a), Dst: 96:62:08:fb:22:8a (96:62:08:fb:22:8a)
    Internet Protocol Version 4, Src: 10.17.2.41, Dst: 10.17.2.110
    Transmission Control Protocol, Src Port: 40664, Dst Port: 1882, Seq: 3, Ack: 3, Len: 367
    MQ Telemetry Transport Protocol, Publish Message
        Header Flags: 0x30, Message Type: Publish Message, QoS Level: At most once delivery (Fire and Forget)
            0011 .... = Message Type: Publish Message (3)
            .... 0... = DUP Flag: Not set
            .... .00. = QoS Level: At most once delivery (Fire and Forget) (0)
            .... ...0 = Retain: Not set
        Msg Len: 364
        Topic Length: 30
        Topic: tele/power_MainVera/HASS_STATE
        Message [truncated--see above]: {"Version":"9.1.0(tasmota)","BuildDateTime":"2020-11-07T11:57:45","Module or Template":"Gosund-WP5","RestartReason":"Software/System restart","Uptime":"6T05:50:22","Hostname":"power_MainVera-0278","IPAddress":"10.17.2
    
    openLuup

  • openLuup: Tasmota MQTT Bridge
    B Buxton

    @buxton In the above, I'm seeing an extra closing right hand bracket in the JSON string.

    Plugins

  • Tinkering with Tasmota sensors
    B Buxton

    I've been waiting for something like this. Very cool. Thx for the post

    Hardware

  • openLuup: MQTT server
    B Buxton

    @akbooer
    And a ping response from bridge to main instance:

    Frame 33: 68 bytes on wire (544 bits), 68 bytes captured (544 bits) on interface eth0, id 0
    Ethernet II, Src: 96:62:08:fb:22:8a (96:62:08:fb:22:8a), Dst: Advansus_0a:8c:3a (00:19:0f:0a:8c:3a)
    Internet Protocol Version 4, Src: 10.17.2.110, Dst: 10.17.2.41
    Transmission Control Protocol, Src Port: 1882, Dst Port: 40664, Seq: 5, Ack: 2851, Len: 2
    MQ Telemetry Transport Protocol, Ping Response
        Header Flags: 0xd0, Message Type: Ping Response
            1101 .... = Message Type: Ping Response (13)
            .... 0000 = Reserved: 0
        Msg Len: 0
    
    openLuup

  • Release 1.0.0
    B Buxton

    @toggledbits I was able to install the container through compose, however, I had to make some changes to get it working. See below for my compose file:

     MSR:
      container_name: reactor
      image: toggledbits/reactor:latest-generic-amd64
      restart: "on-failure"
      environment:
       REACTOR_DATA_PREFIX: /var/reactor
       TZ: America/Los_Angeles
      expose:
       - 8111
      ports:
       - 8111:8111
      volumes:
       - /home/username/reactor:/var/reactor
       - /etc/localtime:/etc/localtime:ro
      tmpfs: /tmp
    #  logging:
    #   driver: "json-file"
    #   options:
    #    max-file: 5
    #    max-size: 2m
    

    The changes I made are:
    1.) substitute "MSR" for "web" for the service name. This was just a precaution against a generic service name interfering with container management programs I use, and was not a needed/critical change to get things working.
    2.) simplify the volume syntax for binding a data volume. The syntax you have on your website caused a yaml compile error with version: '3.7' compose.
    3.) comment out the logging options. These options compiled, but threw a runtime JSON error that stopped the container from coming up:

    ERROR: for MSR  Cannot create container for service MSR: json: cannot unmarshal number into Go struct field LogConfig.HostConfig.LogConfig.Config of type string
    ERROR: Encountered errors while bringing up the project.
    

    I hope to cut out some time next week to start forming some logic. The web UI looks great.

    Multi-System Reactor

  • openLuup: Tasmota MQTT Bridge
    B Buxton

    @akbooer No errors in 2021.04.18. Thanks for this as the changes also stabilized my Mosquitto bridge connection, which tended to flop with every error message.

    2021-04-18 15:29:04.173   luup.tasmota:262: Topic ignored : tele/power_ServerWork/LWT : Online
    2021-04-18 15:29:04.175   luup.tasmota:262: Topic ignored : tele/power_MainVera/LWT : Online
    2021-04-18 15:29:04.176   luup.tasmota:262: Topic ignored : tele/power_HAServer/LWT : Online
    2021-04-18 15:29:04.177   luup.tasmota:262: Topic ignored : tele/power_SideLandscape/LWT : Online
    2021-04-18 15:29:04.178   luup.tasmota:262: Topic ignored : tele/power_GarageVera/LWT : Online
    
    Plugins

  • openLuup: MQTT server
    B Buxton

    @akbooer

    The Connect packet:

    MQ Telemetry Transport Protocol, Connect Command
        Header Flags: 0x10, Message Type: Connect Command
        Msg Len: 94
        Protocol Name Length: 4
        Protocol Name: MQTT
        Version: Unknown (132)
        Connect Flags: 0xec, User Name Flag, Password Flag, Will Retain, QoS Level: At least once delivery (Acknowledged deliver), Will Flag
            1... .... = User Name Flag: Set
            .1.. .... = Password Flag: Set
            ..1. .... = Will Retain: Set
            ...0 1... = QoS Level: At least once delivery (Acknowledged deliver) (1)
            .... .1.. = Will Flag: Set
            .... ..0. = Clean Session Flag: Not set
            .... ...0 = (Reserved): Not set
        Keep Alive: 60
        Client ID Length: 14
        Client ID: Thing.MosquittoBridge
        Will Topic Length: 43
        Will Topic: $SYS/broker/connection/Thing.MosquittoBridge/state
        Will Message Length: 1
        Will Message: 0
        User Name Length: 6
        User Name: YYYYYY
        Password Length: 10
        Password: XXXXXXXXXX
    
    openLuup

  • openLuup: Tasmota MQTT Bridge
    B Buxton

    @akbooer No historian errors and all "checked" variables are publishing to my InfluxDB server.

    Plugins

  • openLuup: MQTT server
    B Buxton

    @akbooer
    The subscribe packet:

    Frame 156: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) on interface eth0, id 0
    Ethernet II, Src: Advansus_0a:8c:3a (00:19:0f:0a:8c:3a), Dst: 96:62:08:fb:22:8a (96:62:08:fb:22:8a)
    Internet Protocol Version 4, Src: 10.17.2.41, Dst: 10.17.2.110
    Transmission Control Protocol, Src Port: 36446, Dst Port: 1882, Seq: 147, Ack: 9, Len: 15
    MQ Telemetry Transport Protocol, Unsubscribe Request
        Header Flags: 0xa2, Message Type: Unsubscribe Request
            1010 .... = Message Type: Unsubscribe Request (10)
            .... 0010 = Reserved: 2
        Msg Len: 5
        Message Identifier: 2
        Topic Length: 1
        Topic: #
    MQ Telemetry Transport Protocol, Subscribe Request
        Header Flags: 0x82, Message Type: Subscribe Request
            1000 .... = Message Type: Subscribe Request (8)
            .... 0010 = Reserved: 2
        Msg Len: 6
        Message Identifier: 3
        Topic Length: 1
        Topic: #
        Requested QoS: At most once delivery (Fire and Forget) (0)
    
    openLuup

  • openLuup: MQTT server
    B Buxton

    @akbooer

    The connect ACK:

    MQ Telemetry Transport Protocol, Connect Ack
        Header Flags: 0x20, Message Type: Connect Ack
            0010 .... = Message Type: Connect Ack (2)
            .... 0000 = Reserved: 0
        Msg Len: 2
        Acknowledge Flags: 0x00
            0000 000. = Reserved: Not set
            .... ...0 = Session Present: Not set
        Reason Code: Success (0)
    
    
    openLuup

  • openLuup: MQTT server
    B Buxton

    @akbooer Yes but as you can see on the connect, the version is "Version: Unknown (132)"

    This is what is causing the problem. After much searching and trying different configs, I stumbled on the following which solved the problem. From mosquitto.org

    try_private [ true | false ]
    If try_private is set to true, the bridge will attempt to indicate to the remote broker that it is a bridge not an ordinary client. If successful, this means that loop detection will be more effective and that retained messages will be propagated correctly. Not all brokers support this feature so it may be necessary to set try_private to false if your bridge does not connect properly.
    
    Defaults to true.
    

    So I set the attribute to false in my bridge config and immediately connected openLuup to the mosquitto broker. The connect packet shows the right version, and with a luup reload, all of my mosquitto broker topics populated in mqtt explorer that was pointed at openLuup. However, I don't see the topics in the mqtt console on openLuup?? Which is odd because I not only see the openLuup topics in explorer, but I see the topics actively changing.

    I'm not a good one to suggest code changes, but since this mosquitto setting defaults to true, can you try to incorporate the try_private flag in openLuup's MQTT server.... It took a long time to track this down and I imagine anyone else that tries to connect the two servers will be in for a similar bug fix adventure.

    openLuup

  • openLuup: MQTT server
    B Buxton

    2b910604-bd05-486e-8f8a-603da5af8422-image.png image url)

    openLuup Explorer

    openLuup

  • openLuup: MQTT server
    B Buxton

    @akbooer Yes, I was thinking along those lines as the bridge config allows filters. The latest openLuup version now works fine with try_private flag set to default (true). Thanks for nailing this down and your work is definitely appreciated. Below is the connection to openLuup.

    419b97dc-b06a-4e78-a4a8-6c2b33f45fed-image.png

    Here's my Mosquitto config for anyone who wants to bridge the two brokers:

    allow_anonymous true
    password_file /mosquitto/data/PW.txt
    listener 1883
    connection openLuup
    address 127.0.0.1:1882
    topic # out 0
    topic # in 0
    cleansession false
    notifications true
    username XXXXX
    password YYYYYYYYYY
    bridge_protocol_version mqttv311
    

    Most of these settings can/should be modified to suit one's particular needs, but the settings should be employed. The password file for mosquitto needs to be encrypted with mosquitto's built-in encryption tool. The directions are straightforward and are described in on-line documents.

    openLuup
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved