I have HA v0.111.4 and it seems that Service Switch is missing under developer tools. Also calling REST API with working token /api/services/switch/turn_on returns 400: Bad Request
Have I missed some important change or has the switch really been disabled? How do the automations work now as I cannot call switch?
Check your log for errors, perhaps an invalid switch configuration is preventing the switch platform from being set up. I’m on the same version and can see the services:
I was going to suggest checking if you had switch: in your configuration.yaml file but assumed you did as it sounded like you previously had working switches. So I went with the probable cause being an invalid config instead.
I was toggling around with enhanced I2C polling scripts.
But still something is off as automations are not actiwating switches when sensor state is changed.
They worked earlier just fine, but now they can only be activated when I push EXECUTE button on HA UI or directly enable the switch. Changing the sensor state via physical button or API does not trigger the automation.
Any ideas if the automation ‘encoding’ has changed, i.e. how the automation is defined? Could it be that the platform state to ON is missing the sensor state change in more recent HA version?
The sensor state has been changed:
This worked previously:
- id: '201708130001'
alias: 'WC light'
trigger:
- entity_id: sensor.i2c_tek_pin_in_01
platform: state
to: 'on'
action:
- entity_id: switch.i2c_tek_pin_out_01
service: switch.toggle