2017-07-30 17:07:44 ERROR (Thread-2) [homeassistant.util.yaml] while parsing a block mapping
in "/home/homeassistant/.homeassistant/configuration.yaml", line 1, column 1
expected <block end>, but found '<block mapping start>'
in "/home/homeassistant/.homeassistant/configuration.yaml", line 451, column 2
2017-07-30 17:07:44 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in "/home/homeassistant/.homeassistant/configuration.yaml", line 1, column 1
expected <block end>, but found '<block mapping start>'
in "/home/homeassistant/.homeassistant/configuration.yaml", line 451, column 2
right so I got it working but I have the same issues as earlier i.e. it doesn’t work when the temperature goes above 18 degrees celsius because at present the temperature is above 19.5 and it doesn’t seem to turn the Kitchen Lights on.
Note that the ’ | float ’ is only necessary if your sensor send data as a string and not as a numeric (which is the case using Ben’s code I think).
Note also that there is a template utility in development tools on the frontend. You can type in your template in this utility and directly see the result, so you can mess around freely and change it to suit your needs. Here is a screenshot of the test I just did
However, I think that using this automation like that, your fan will always be turning on as soon as long as the temp is > 18; even at night, even when no one is home. So you may want to put some conditions to limit it and save some money on the electricity bill.
does your template action straight away i.e. if the temperature is greater than 18, would it turn the e.g. lights right away? because like @SeveredDime mentioned:
it’s because the automation doesn’t technically trigger because the temp is already above the set point when you started. The temp didn’t go from 17.9 to 18.0. so it doesn’t fire.
The template trigger will always be true as long as the temp is above 18 (even if it is already above 18 when you restart HASS). Meaning that if for some reason you manually turn off the switch, the automation will directly turn it on if the temp is still > 18. (which may be annoying).
That is the difference with numeric_state above 18. In that second case, the trigger will turn true when the temp goes from under 18 to 18 or more. So it triggers only when the threshold is crossed.