Any ideas why

Hi, This is driving me nuts. I have created a hot water sensor and switch using an ESP8266 and the arest platform. The reading are coming in ok to HA and the switch is working fine manually. I can’t seem to get this automation to work. Basically I want it to turn the switch on when it goes over a certain value. I have checked all the id’s in the development tools section. Any ideas why this is not working.

automation:
alias: Hot Water On when over value
condition:
platform: arest
entity_id: sensor.hot_water_temperature
above: 300
action:
platform: arest
service: switch.turn_on
entity_id: switch.hot_water_hot_water_on

Thanks

You seem to be missing a trigger. Conditions only apply after the trigger occurs.

Hi, Thanks for your reply.

I tried the following and still no joy:

Try 1:

automation:
alias: Hot Water On when over value
trigger:
platform: arest
entity_id: sensor.hot_water_temperature
condition:
platform: arest
entity_id: sensor.hot_water_temperature
above: 100
action:
platform: arest
service: switch.turn_on
entity_id: switch.hot_water_hot_water_on

Try 2:

automation:
alias: Hot Water On when over value
trigger:
platform: arest
entity_id: sensor.hot_water_temperature
above: 100
action:
platform: arest
service: switch.turn_on
entity_id: switch.hot_water_hot_water_on

Then just to try something a bit more basic I tried the following:

automation:
trigger:
platform: wemo
entity_id: switch.wemo_switch
event: turn_on
action:
platform: arest
service: switch.turn_on
entity_id: switch.hot_water_hot_water_on

This was to turn on the arest switch when my wemo switch was turned on. Even this did not work. Feeling very stuck.

Thanks

Hello,

Just to keep it very simple I tried the following. Effectively trying to get the automation working. I have tried many combinations but am having no luck. In this I am aiming that once the wemo switch goes on the arest goes on as well. Can anyone see what I am doing wrong? Also, a question, how important is it for the spaces to be correct?

automation:
alias: Test routine
trigger:
platform: wemo
entity_id: switch.wemo_switch
event: turn_on
action:
platform: arest
entity_id: switch.hot_water_hot_water_on
service: switch.turn_on

Thanks

The spaces are critical. Can you paste your automation config with the forum’s code tag. Then it will show up correctly:

test:
  spaces:
     more:
automation:
  alias: Test routine
  trigger:
    platform: wemo
    entity_id: switch.wemo_switch
    event: turn_on
  action:
    platform: arest
    entity_id: switch.hot_water_hot_water_on
    service: switch.turn_on

Hi, here it is. I have tried it two ways. One way with one space and the one shown with two spaces.

Thanks

Your formatting looks good.

For your trigger: “wemo” is not a valid trigger platform. Consider the following instead:

  trigger:
    platform: state
    entity_id: switch.wemo_switch
    to: 'on'

For your action, no platform need be specified. Consider the following instead:

  action:
    service: switch.turn_on
    entity_id: switch.hot_water_hot_water_on

Hi, Thanks for the code. It worked well.
I have now tried to go back to the initial code so my switch goes on when the sensor is above 250 and goes off below it. I got it somewhat working but the led seems to come on randomly. This code is not working but seems to be closer. Is there something I am doing wrong?


automation:
  trigger:
    platform: numeric_state
    entity_id: sensor.hot_water_temperature
  condition:
    above: 250
  action:
    service: switch.turn_on
    entity_id: switch.hot_water_hot_water_on

  trigger:
    platform: numeric_state
    entity_id: sensor.hot_water_temperature
  condition:
    below: 250
  action:
    service: switch.turn_off
    entity_id: switch.hot_water_hot_water_on

  1. Specify a platform for your condition.
  2. To include multiple automations, do like this:
automation:
- alias: ...
  trigger: ...
   ...
- alias: ...
  trigger: ...
   ...

Hi, Thank you. It now all works fine.
Here is the final code in case anyone else needs it.

automation:
- alias: CH On
  trigger:
    platform: numeric_state
    entity_id: sensor.hot_water_temperature
    above: 250
  action:
    service: switch.turn_on
    entity_id: switch.hot_water_hot_water_on

- alias: CH Off
  trigger:
    platform: numeric_state
    entity_id: sensor.hot_water_temperature
    below: 249
  action:
    service: switch.turn_off
    entity_id: switch.hot_water_hot_water_on

Hi @ajafferji

What sensor are you using and where have you connected it?