I have power plug (Gosung SP111), everything is fine. But when I physically unplugged from the outlet, then OH still showing old values of plug. LWT is correct - “offline” (like on the picture):
Yes. In the MQTT thing configuration should have availability topic and payload settings. If you fill these in then the MQTT binding knows to use that topic and those values to display the thing’s online/offline status.
I have 2 ideas…
First: Just switch off the plug before unplug from outlet… The the values should changed to 0.
Second:
Set your widget to invisible if the plug is offline…
I think you can’t change the values if the thing is active.
I set a string item from a http binding channel per rule. But this is only possible if the thing is on pause (uninitialized)
Greets.
Your plug is wifi? Try network binding and ping the device…
Greets
Edit:
But you see if the device is offline and you have a rule for it… What do you want to achieve? Just set values right?
then switch off before unplug the device…
Or like I said, turn thing off, set values, and turn thing on again.
I think this will work…
I got it! I think I can use “postUpdate” command - it works!
I don’t know if it’s in accordance with art and good manners of OH and that’s how it should be used, but it works, so I can define a rule that when the device is offline, then on items like voltage/current/power I have to do postUpdate.