Is it possible to set a state of a script? diesel heater

script state always state off even when I run script is it possible to set a state?

No, you do not set the sate of the script. It turns itself on when running. If you have no delays or loops in your script it will run and complete very quickly. If you look closely at the history graph for the script you will see this sliver of a state change:

Or view the log book entry in the more info pop-up card.

Compared to one of my scripts that has lots of delays in it that takes 30 seconds to complete:

thanks for the info
my script is for my RM4 pro to turn on my Diesel Heater

service: remote.send_command
data:
hold_secs: 1.1
device: Diesel Heater
command: power on
target:
device_id: 2d12345678919.eg
enabled: true

ive looked can’t see anything

It’s a script so it does nothing until a person, or automation, executes it.

Who or what is executing this script?

got it to show in logbook :slight_smile:

I add this to script.yaml

logbook diesel heater

add_logbook_entry:
alias: “Add Logbook”
service: logbook.log
data:
name: Diesel Heater
domain: remote
entity_id: script.diesel_heater_on
message: is now on

thanks Taras I know its a script
I made the script I can turn on manually and with automation I wanted to see if I could set state to see when it turn on or off but thanks to tom_I I can see in log book