You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to execute a service when server is down?
I use this widget to monitor my buggy internet connection.
Often the problem is the router that stop working so I need to reboot it. The router as an old OpenWrt firmware with a ping reboot, but it isn't working.
So I wrote a pyscript to reboot it.
I didn't find a way to call this service without user intervention when uptime-card find that the connection is down.
Creating an automation based on the state it's a little cumbersome...
Another possibility is to trigger the script based on ko... I didn't realize what's the name I have to put in state_trigger...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it possible to execute a service when server is down?
I use this widget to monitor my buggy internet connection.
Often the problem is the router that stop working so I need to reboot it. The router as an old OpenWrt firmware with a ping reboot, but it isn't working.
So I wrote a pyscript to reboot it.
I didn't find a way to call this service without user intervention when uptime-card find that the connection is down.
Creating an automation based on the state it's a little cumbersome...
Another possibility is to trigger the script based on ko... I didn't realize what's the name I have to put in state_trigger...
@state_trigger("binary_sensor.internet == 'ko'") @service def reboot_router(action=None, id=None):
Beta Was this translation helpful? Give feedback.
All reactions