Input_boolean in script

Hi

is it possible to change an input_boolean from a script? HomeAssistant can not detect if a TV is powered on (afaik).

So I have this script

scenetv:
  sequence:
    - service: remote.send_command
      entity_id: remote.harmony
      data:
        device: "Tv 43inch"
        command: 
          - "PowerOn"

so here I would like to set the input_boolean.tv_power to ‘on’.

Is this possible?

Call service, input boolean turn on.

If the TV is smart then you might be able to see if it’s on.
If not then you can use the USB output, an ESP and a voltage divider to sense if it’s on or off

Yes.

It can if the TV has an integration.
You could also measure its power consumption or ping it (if it has a network interface that turns off in standby).

If you have a TV with assumed state and you are using a remote I would suggest that you take a look at this:

You can make your own media_player entity for the TV.