Script to turn off pc

Hi guys,

I’m pretty new to Home Assistant. I’ve already googled for my problem but the solutions i’ve found didn’t worked for me.
I’m trying to turn off my pc via a script calling a joaoapps service. This is my script:

pc_off:
  sequence:
      - service: joaoapps_join.computer_send_tasker
        data:
          command: shutdown

But when i save it i get the message:

Message malformed: Service joaoapps_join.dell-xps_send_tasker does not match format domain.name for dictionary value @ data[‘sequence’][0][‘service’]>

any advice?
thx

Why does your example contain this service name:

joaoapps_join.computer_send_tasker

but the error message contains:

joaoapps_join.dell-xps_send_tasker

Are you actually using dell-xps_send_tasker but changed it to computer_send_tasker just for the example?

If you are actually using dell-xps_send_tasker then the name contains a hyphen (-) which is an invalid character for an entity_id or service name in Home Assistant.

3 Likes

sorry, the example and the message contains different names because copy/paste error.
You were right, it was the hyphen.

You saved the day, thank you!

1 Like