CyberDNS / Lupusec2Mqtt

Lupusec Alarm System to Mqtt
MIT License
11 stars 5 forks source link

Small Problem with Powerswitches #53

Closed mbay0r closed 1 year ago

mbay0r commented 1 year ago

Good morning,

I have included several power plugs in the lupus, they also work fine with the addon.

But there is a small error:

Is this behavior so normal?

[08:11:59 INF] Command homeassistant/switch/lupusec/ZS_1e1803/set of device ZS:1e1803 - Strom Wohnzimmer executed with input OFF
[08:11:59 INF] Value for topic homeassistant/switch/lupusec/ZS_1e1803/state on device ZS:1e1803 - Strom Wohnzimmer changed from ON to OFF
CyberDNS commented 1 year ago

Hi,

No the behavior was not intended. The switch entity in HA changes directly to the new value and does not wait to get the new value back from MQTT.

So mainly, you click the the button goes directly to the new state, the click sends a "command" to MQTT, this one is then processed by the Addon, sent to you Lupusec and then the addons polls the lupusec for state every 2 seconds and then when the state comes back, it pushes the value to MQTT that is finally read by HA.

Now, when this process takes to much time, HA has a small delay where it leaves the switch on the intended state, but when it is not "confirmed" by the real state in MQTT, it goes back to the value it has in MQTT.

So I added now that after every "command", the addon will directly get the new state from the lupusec and publish it to MATT/HA. Hope this resolves the problem.

The version is published under 3.0.11 Edge.

mbay0r commented 1 year ago

Good Morning and Thank you. still happens when turning off.

CyberDNS commented 1 year ago

New version 3.0.12 Edge available.

Saving now the state of the last command executed for up to 4 seconds to provide temporarily the last state executed by the command.

mbay0r commented 1 year ago

👍 Perfect

mbay0r commented 1 year ago

Thank you!