I’ve been successfully using the REST API from my octoprint server to turn ON/OFF the printer when a new print comes in. This had been working for a long time, but yesterday it failed to work and I’m not able to figure out why. I’m wondering if a software update broke this and it went unnoticed because I didn’t use the printer for a while.
The switch I’m using is a Minoston Z-Wave switch, but I’m not sure how relevant it is since I can reproduce this problem with a Kasa (IP based) switch too.
My REST API calls to POST (set the state) are successful, and I do see the toggle UI element flip when I turn things ON or OFF via the API, but the plug itself does not change state. However, if I call HTTP GET after my POST, the API returns the state I set correctly, but again, that is not what the actual device is doing.
However, if I manually toggle the switch from the web UI, it works, and the switch will match what I set in the UI.
The event logs are slightly different between the Z-Wave switch and the Kasa switch, when I use the HTTP POST API:
- Z-Wave: - Shows a “Turned on” event (but the actual device does not turn on)
- Kasa: - Shows a “Turned on” event followed by a “Turned off” event 5 seconds later (the log doesn’t show what initiated the Off event)
Has anyone seen this before? Any way I can debug this further?
System Info:
Home Assistant 2023.9.2
Supervisor 2023.09.2
Operating System 10.5
Frontend 20230911.0 - latest
Thanks!