Can't get simple automation to work

Hi!

Seems like i can’t even get the simplest of automation to work.
I’ve search all over but can’t figure it out.

I want to trigger a switch on/off based on temperature.
If i trigger the automation in the GUI manually the switch turns off and on. But it seems like i’m reading the temperature wrong since it dosen’t matter what temperature it is. Nothing gets triggered.

I have this in my configuration.yaml:
`automation:

  • alias: Turn on bedroom heater
    trigger:
    platform: numeric_state
    entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_2_1
    below: 18
    action:
    service: switch.turn_on
    entity_id: switch.telldus_tzwp100_plugin_switch_switch_6_0
  • alias: Turn off bedroom heater
    trigger:
    platform: numeric_state
    entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_2_1
    above: 19
    action:
    service: switch.turn_off
    entity_id: switch.telldus_tzwp100_plugin_switch_switch_6_0`

What is the value/state of sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_2_1

Make sure its a number and nothing else

Do you have any error messages in your log?

Hi, yes it’s seems to be numeric.

From OZW_log.txt
2017-03-08 20:41:19.239 Detail, Node005, Refreshed Value: old value=28.40, new value=27.28, type=decimal

In the GUI:

Are you sure it isn’t working? It seems like it should, I was looking for more of an error message in the logs I meant. And see if there is a tile that says something like invalid config for automation on your front page of the dashboard.

I’ve restarted and reloaded and validated what feels like 100 times.

Only entry in the logs is a few hours back:
17-03-08 20:22:29 WARNING (MainThread) [homeassistant.core] Unable to find service switch/turn_off

I’m quite noob myself, so take this with a pinch of salt, but instead of

service: switch.turn_on

try

service: homeassistant.turn_on

I have no idea what the difference is, but my fibaro light switches use the latter in their automations (from copying an example on here) rather than light.turn_on or switch.turn_on

Are you sure you are referencing the right sensor. Your automation refers to a motion sensor which appears to be node 2 but the information you posted from the GUI is for a flood sensor which is node 5.

Yes, found that in some other thread and tried it. Unfortunately it did not work either.
It works if i manually trigger the automation so i don’t think that part is to blame.

Sorry, my bad tried a different sensor as well. Still didn’t work.

I’d use climate component:
in configuration.yaml include the file:
climate: !include climate.yaml
create new file climate.yaml with content:

  - platform: generic_thermostat
    name: Bedroom
    heater: switch.telldus_tzwp100_plugin_switch_switch_6_0
    target_sensor: sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_2_1
    min_temp: 16
    max_temp: 25
    target_temp: 19
    tolerance: 0.5

and restart HASS

Or try this (note the added lines)…

automation:
  - alias: Turn on bedroom heater
    trigger:
      platform: numeric_state
      entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_2_1
      value_template: '{{ state.attributes.temperature }}'  ###This line - attribute may be wrong
      below: 18
    action:
      service: switch.turn_on
      entity_id: switch.telldus_tzwp100_plugin_switch_switch_6_0
- alias: Turn off bedroom heater
  trigger:
    platform: numeric_state
    entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_temperature_2_1
    value_template: '{{ state.attributes.temperature }}'  ###This line - attribute may be wrong
   above: 19
  action:
    service: switch.turn_off
    entity_id: switch.telldus_tzwp100_plugin_switch_switch_6_0