A hassio user here. So I created this to add to my fronted to switch on my Xbox. I have the Xbox Addon install to act as the server (i think??).
The problem is that when the rest platform is enabled it switches my Xbox on constantly, like 10 seconds after i switch it off, and it just repeats this behavior.
Any suggestions?
- platform: rest
resource: http://192.168.0.XX:5557/device/FD00XXXXXXXXXXXX/poweron
name: Xbox One Test
is_on_template: '{{ value_json.success }}'
You don’t show the full config (i.e., what is this platform config under?), but this is (probably) happening because you’re using a RESTful Sensor instead of a RESTful Switch. A sensor periodically polls, which is why it’s continually sending the GET request and turning on the Xbox. You should either use the RESTful Switch, or maybe a RESTful Command, depending on exactly what you’re trying to accomplish.
OK so i changed what i was trying to do - This way turns on and off the xbox but the state of the switch stays “off”. It will turn on for 3 seconds then revert back to off but the xbox stays on.
Which ping component are you using? Again, you don’t show that. (There are multiple components that have a ping platform.) Is it a binary_sensor? If so, its state will be 'on', not 'On' (i.e., all lower case.)