I have witnessed now several instances where the Kasa integration is sending a device toggle it seems, instead of sending the actual desired state.
For example, I have a rule machine rule that is supposed to turn the garage lights on, when the garage entry door is unlocked.
If the lights are off, it turns them on. If they are on, it turns them off. The rule is set to turn the lights on, not toggle.
In another case, I have a Hubitat virtual switch configured to turn on several Kasa devices.
If someone goes into the Kasa app, and say turns on one of the devices, but the others are off, if I turn the virtual switch on, all the devices turn on, except for that device that's already on, it turns off.
When I try and turn the virtual switch off, the off device turns on, and the on devices turn off.
Why is the state being toggled, instead of just setting the desired state?
I believe this is a rule-machine issue. The Kasa Device uses on/off commands for the Switch capability, not toggle. It simply does what the rule sends.
1 Like
Sharing a screenshot of your rule, plus the output of Logs, filtered to just this rule and maybe the relevant device (with all logging enabled on the rule) would be helpful to troubleshoot the rule.
You might also want to check the device and make sure no other apps are using it in an automation. The "Events" tab will show you a history of commands, too, and what app sent them. Perhaps something else sent the command, to name one possibility (note that this page shows both events and commands, and I'm only talking about commands; hit the "?" button in the upper right of this page to learn more in the docs).
2 Likes
But its NOT a rule problem, as I mentioned, the same thing happens with just a virtual switch.
Here's the virtual switch turning ON....
Here, the Kasa device was already on...and you can see the virtual switch turning it off, when the switch was supposed to be turning it on...
Virtual switches can't turn anything off or on on their own. Some app, such as a rule, must be doing that. Without seeing that rule, or whatever app or apps are doing this, plus all logging from them, it's hard to tell what's really happening for you. If "Great Room TV" is an app (and all hints in your screenshot suggest it is indeed an app, like an RM rule -- though there is very little to go by), that is the one I would start looking at by enabling all logging, as suggested above.
The screenshots alone aren't problematic: an off command got sent to a switch, and it turned off. That is expected. If you're using a "toggle"-type action in an app and are expecting it to send an "on" instead of an off, that would almost certainly be because your device is not reporting its current state correctly back to the hub. (For example, at the moment before this command, it looks like it last reported as "on.) The hub needs the correct current state to "toggle" correctly, as that is an app feature, not a feature natively found as a device command on most Hubitat devices. Just a guess with the little given above...and something that may help narrow down your problem.
2 Likes