I’ve been using HA for a week now and this is my first time on the board. I have a problem configuring the automation part correctly. I’ve copied below conf from these forums and they’ve got it working. Somehow I get an error message (included below).
My system is using google calendar to schedule sauna heating cycles. Everything else except automation triggering the action part works.
Also working: temperature and humidity sensors. So far, HA is the best system I’ve tried by far: fast & reliable. A bit finicky in configuring.
This system is running on pine64, OS: armbian 3.10.107-pine64 arm64/aarch64 ubuntu 16.04 based and HA version is 0.58.1 on python virtual env (version 8). configuration.yaml https://pastebin.com/Z85YDV4a
While debugging I use the console to start HA. Normally, I’d use systemd to for starting Error message
(homeassistant) homeassistant@pine64:~$ hass
Config directory: /home/homeassistant/.homeassistant
2017-12-04 12:16:43 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
in "/home/homeassistant/.homeassistant/configuration.yaml", line 96, column 16
2017-12-04 12:16:43 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
in "/home/homeassistant/.homeassistant/configuration.yaml", line 96, column 16
I’ve also tried about 50 different ways copied directly from various documentation sources. Nothing seems to work.
Could somebody point me in the right direction?
Any help would be greatly appreciated.
I see… it needs double the condition. but the errors do persist
automation part from configuration.yaml now is:
automation:
- alias: Heatup
hide_entity: false
initial_state: 'off'
trigger:
platform: state
entity_id: sensor.heating_alarm
from: 'off'
to: 'on'
condition:
condition: state
entity_id: states.calendar.sauna
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.saunan_lammitys
Console error is
2017-12-04 13:27:53 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: Entity ID states.calendar.sauna is an invalid entity id for dictionary value @ data['condition'][0]['entity_id']. Got None
extra keys not allowed @ data['condition'][0]['state']. Got None
not a valid value for dictionary value @ data['condition'][0]['condition']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 86). Please check the docs at https://home-assistant.io/components/automation/
I think you should take that off. Don’t think it will run with that in, unless in another code you are turning it ON. Made that mistake before, and didn’t release until I went via my code one line at a time as I copied and pasted.
Is it that the ‘initial_state’ is turning that part of automation into not-in-operation state? I thought it was the state of the condition or something…
Well what it does is that it disables the automation as a whole, and so it wouldn’t run even if triggered. I once use to use it to run as a timer, before the timer component was developed. So initially it is OFF, then in my code I turn it ON/OFF using the homeassistant.turn_xx service.