I have a Tuya smart plug integration and I have a 3D printer connected. I have sensors for the printer setup in my configuration.yaml
Eg sensor.printer_current, printer_filename, printer_timerrmaining etc. These are set to check every 10 minutes.
What I want to do it automate it so when the Tuya plug is off, don’t poll the sensors (then I don’t have to see the constant unable to connect to sensor.printer_xyz in the logs all the time. And of course the opposite behaviour.(I believe I could use the update_entity call when the plug state is “on” to force checks of said sensors, just don’t know how to do the disable.
Another reply to one of my old posts in case anyone else is interested in my solution. (AKA probably me when I go searching for the same issue again in a years time)
I ended up making two automations:
First I check the state of the plug to which my Octoprint Raspberry Pi is connected (you can use anything here).
Then if its off, I know my printer won’t be printing…so I disable all the sensors