Re: [mh] MQTT Not Reliable
Dave Neudoerffer <[email protected]> Sun, 20 Aug 2023 17:35:24 -0400
| Newsgroups | gmane.comp.misc.misterhouse.user |
|---|---|
| Message-ID | <CAOFx8LMJTvJd-jBrHvLpv86ctax8ZkokVyGuWLo4WBjOOYeaSw@mail.gmail.com> |
Hi Stephen, I have done quite a bit of work on the mqtt support. I also have some pending changes that may help with your issues. I will try and get that submitted in the next couple days. Dave On Sun, Aug 20, 2023, 4:41 PM Stephen Switzer <[email protected]> wrote: > I'm probably running an old version of MH, so if this has been fixed in > the past 1-2 years, then please tell me to update. :) > > I created an integration that has MH listening to the mosquito broker for > some light commands, and for the most part, it's working. However, it seems > that random lights do not work when I send a MQTT command to the broker. I > can see the command hit the broker, but it won't trigger an event in MH for > all lights. I see no difference between the lights that work and those that > do not. > > Mosquito Broker: > insteon/living_room_lamp on > insteon/living_room_lamp/state on > > insteon/living_room_fan_light on > caddx/motion/binary_sensor.living_motion/state on > insteon/living_room_lamp off > caddx/motion/binary_sensor.living_motion/state off > insteon/living_room_lamp/state off > > > MH: > 08/20/23 03:21:57 PM [MQTT_RECV] living_room_lamp: on > 08/20/23 03:21:59 PM [LIGHTS] $ll_liv_lamp1 is 100% > 08/20/23 03:21:59 PM [MQTT_SEND] ll_liv_lamp1: on > > 08/20/23 03:22:06 PM [MQTT] MQTT_living_motion: on > 08/20/23 03:22:07 PM [MOTION] Motion sensed in Living. > 08/20/23 03:22:10 PM [MQTT_RECV] living_room_lamp: off > 08/20/23 03:22:12 PM [MQTT] MQTT_living_motion: off > 08/20/23 03:22:12 PM [LIGHTS] $ll_liv_lamp1 is off > 08/20/23 03:22:12 PM [MQTT_SEND] ll_liv_lamp1: off > > You can see MH is listening to the broker, sending messages successfully, > etc. The living_room_fan_light event was not picked up from the broker by > MH. I don't see why. Here's the code snippets: > > > $MQTT_insteon = new mqtt('mqtt_1', '127.0.0.1', 1883, 'insteon/#', "", "", > 120); > > $MQTT_insteon_living_room_fan_light_set = new mqtt_Item($MQTT_insteon, > "insteon/living_room_fan_light"); > $MQTT_insteon_living_room_fan_light_state = new mqtt_Item($MQTT_insteon, > "insteon/living_room_fan_light/state", 1, 1); > if(my $state = state_changed $MQTT_insteon_living_room_fan_light_set) { > print_log("[MQTT_RECV] living_room_fan_light: $state"); > set $living_room_fan_light $state; > } > if($state = state_now $fl_liv_fanlight) { > $state = ON if $state == '100%'; > print_log("[MQTT_SEND] fl_liv_fanlight: $state"); > set $MQTT_insteon_living_room_fan_light_state $state; > } > > $MQTT_insteon_living_room_lamp_set = new mqtt_Item($MQTT_insteon, > "insteon/living_room_lamp"); > $MQTT_insteon_living_room_lamp_state = new mqtt_Item($MQTT_insteon, > "insteon/living_room_lamp/state", 1, 1); > if(my $state = state_changed $MQTT_insteon_living_room_lamp_set) { > print_log("[MQTT_RECV] living_room_lamp: $state"); > set $living_room_lamp $state; > } > if($state = state_now $ll_liv_lamp1) { > $state = ON if $state == '100%'; > print_log("[MQTT_SEND] ll_liv_lamp1: $state"); > set $MQTT_insteon_living_room_lamp_state $state; > } > > > Mind you, I have about 120 lights in my code, all listening to > $MQTT_insteon. Could there be a memory issue? I appreciate any input with > ideas on this. > > Thank you! > > -- > > Best regards, > Steve Switzer > > --- > Get world-class business I.T. services and a phone system with awesome features that won't challenge your budget!http://www.sbsROC.com > > ________________________________________________________ > To unsubscribe from this list, go to: > https://lists.sourceforge.net/lists/listinfo/misterhouse-users > > ________________________________________________________ To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users