TD22057 / insteon-mqtt

Python Insteon PLM <-> MQTT bridge
GNU General Public License v3.0
99 stars 43 forks source link

Keypadlinc buttons not updated with incoming mqtt command #174

Closed chris153002 closed 3 years ago

chris153002 commented 4 years ago

Hey guys i have noticed that when switch lights from mqtt that the keypadlinc buttons do not change (if i shut off the dining room light the 2 keypads that have buttons mapped to the dining room light stay on, i would then have to turn off that button then turn it back on to turn the dining room light on), i can work around this by sending multiple mqtt commands out ( to the light itself and to each button mapped to that light) but i believe we can look into the device database saved to insteon-mqtt and update these buttons based on those links. has anyone attempted this yet? i am currently following the code to see where/ how it would be done.

mooshee commented 4 years ago

You need to add your keypad buttons as responders to the switches buttons as controllers.

Though I'm current stuck trying to figure out how to make the Fanlinc speed a controller and keypads buttons as responders.

chris153002 commented 4 years ago

all of my buttons are both controllers and responders to the dimmer, the hub and each other. i don't think the fanlinc can be a controller given that there is not physical button.

if you mean that you would like to turn the fan on via MQTT and have the keypad buttons change to match the fan status, that is what i am intending to do here. I just used a light and keypad as an example to simplify things for sake of example. i am having the same issue with the fan lincs as well (turning them on via MQTT and there associated buttons on the keypadLincs don't update).

my intent here is to gain the same functionality as the scene trigger (when you trigger a device scene (I.E. a dimmer would be insteon/kpdiningroomlight/scene/1) you get the local light to turn on as well as all the keypadlinc buttons associated with that light). My issue here is that i often set my dimmers to 25% etc.. later at night. the problem with scene triggers is that they simply are ON and OFF (to my knowledge).

TD22057 commented 4 years ago

Insteon on/off/level commands are not scene commands so other devices are not modified. The scene command simulates turning the device on/off and does issue a scene command so the other devices will be updated properly.

Unless what you're trying to say is that you want to adjust a dimmer to 25% AND have it issue a scene command. One way to do that is to make a virtual scene on the model - pick a group number in the 10-255 range and link the model as a controller to the devices you want updated at whatever dimmer level you want. Then send the modem a scene command for that number and you'll get the levels you want.

If you want to arbitrarily adjust the dimmer of a device AND have it send the scene commands, that might be possible. Looking through the code in the scene method, I think there is a way to do this. The on level is an input in the extended data field, it just currently defaults to whatever is in the device database. So I could try exposing those fields as inputs like the dimmer level method and see what happens.

chris153002 commented 4 years ago

Yes I would try that out. Yes I am looking to be able to set any dimmer to any value ( via mqtt) and have its associated buttons on other devices reflect its status ( same as it would if I physically pressed the dimmer to the brightness I wanted )