Cannot get my wifi switch automated :(

Hi I am having problem when trying to automate my wifi switch. It works fine from web UI I can trun it on/off.

It also works from:
http://host:8123/dev-service
Service: switch.toggle
Entity: switch.schody_led
Service Data(JSON, optional)
{
“entity_id”: “switch.schody_led”
}

So in my .homeassistant/automations.yaml I have:

#### TEST ###
- id: test-light-onoff
  alias: Testing 
  trigger:
    platform: time
    seconds: '/5'
  action:
    service: switch.toogle
    entity_id: 
      - switch.schody_led

I can see automation running in Logbook but it is not operating a switch ?

Any suggestion much appreciated.

Main config for the switch is:

switch:
    switches:
      - host: 192.168.0.123
        mac: AC:CF:23:51:A1:80
        name: "Stairs LED"  - platform: orvibo
        discovery: true

Is there any reason why in your config section you call it Stairs LED and in your automation you refer to it as schody_led?

How about this:

- id: test-light-onoff
  alias: Testing 
  trigger:
    - platform: time
      seconds: '/5'
  action:
    - service: switch.toogle
      entity_id: switch.stairs_led

Thanks gumbo for your clue, I had tried this without success, however it turned out I needed:

 action:
    - service: switch.toogle
      data:
         entity_id: switch.stairs_led

I eventually managed to get it working with UI configurator and than check the config. My main problem was that all examples and docs did not mention data block, but this might be down to specific service provider i used.

Maybe try service.toggle instead of service.toogle

2 Likes