Hi,
I need to add a button with a hhto request.
Is it possibile directly by home? or the first step is crated a SCRIPT?
tks
Alessandro
Hi,
I need to add a button with a hhto request.
Is it possibile directly by home? or the first step is crated a SCRIPT?
tks
Alessandro
may I have an example of script?
Grazie
You don’t need a script for this - you can set up a command_line sensor. The sensor has a polling interval so you don’t need to refresh it manually, but if you want to, you can set your button action to call the service command_line.reload
- this reloads all command line sensors, but that won’t matter if you only have one.
If you don’t want to rely on command_line.reload
, or if you want to do something more complex with the returned data than just put it into the state of a command line sensor, you could also set up a shell_command and use curl
to make your request.