Hi all,
I’ve been using hass since like 0.26 I believe, and have tried to keep up to date. For a while I ran 0.36, then upgraded to 0.39 and tried to stay up to date since then. But somewhere in the last week or two, my automations started firing. Nothing changed in my automation files, and they were all working before, and now none of them work. The only change has been upgrading to a newer version of hass, but I’m not sure if they broke around 0.40, 0.41, or even 0.42.
So as an example, here’s an automation I’m using. Basically, when motion sensor in my home office is on, turn on a specific monitor (this monitor shows a rtsp feed from my front porch so I can see who is at my house while working). When the automation is trigger it starts a script, the script handles a 30 minute delay so the monitor stays on until there hasn’t been motion for 30 minutes. Now there may be a better way to handle all of this, but this is something that has been working for 4+ months until recently and I’m just now finding time to look into it.
./includes/automations/switch_monitor_office.yaml:
#####
### Turn on Monitor (uvmon) if motion is detected
#####
- alias: 'Monitor (uvmon) On'
trigger:
platform: state
entity_id: binary_sensor.multisensor_office_sensor_38_0
to: 'on'
action:
service: homeassistant.turn_on
entity_id: script.timer_office_monitor_on
./includes/scripts/timer_office_monitor.yaml:
timer_office_monitor_on:
alias: 'Turn on Monitor (uvmon) and set timer'
sequence:
- service: script.turn_off
entity_id: script.timer_office_monitor_off
- service: switch.turn_on
entity_id: switch.powerstrip_office_switch_40_0_6
- service: script.turn_on
entity_id: script.timer_office_monitor_off
timer_office_monitor_off:
alias: 'Turn off Monitor (uvmon) after delay'
sequence:
- delay: '00:30:00'
- service: switch.turn_off
entity_id: switch.powerstrip_office_switch_40_0_6
Looking in hass, binary_sensor.multisensor_office_sensor_38_0
has a current state of on
. That sensor is a zwave sensor and I can confirm that it is working. If I leave my office, it will eventually switch to off
(after about a minute or so), and will switch back to on
as soon as I walk back in.
switch.powerstrip_office_switch_40_0_6
is currently in an off
state, and hasn’t kicked back on all morning. That entity is for a specific port on a zwave power strip.
Finally, if I look at the automation.monitor_uvmon_on
entity in hass, it’s state is currently off
and last_triggered
is 2017-04-12T15:18:10.647618+00:00
.
./include/logger.yaml:
default: warning
logs:
homeassistant.components.automation: info
So that’s my current logger settings, but I see no automation logs at all. The only thing in my logs are warnings/errors that trigger at every startup (i.e., invalid switch is_on state, could not render template xxx, state is unknown, etc).
[root@hass homeassistant]# cat home-assistant.log
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_off>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_on>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=toggle>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=restart>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=check_config>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=reload_core_config>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=persistent_notification, service=create>
17-04-18 13:59:09 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
17-04-18 13:59:09 INFO (MainThread) [homeassistant.loader] Loaded mqtt from homeassistant.components.mqtt
17-04-18 13:59:09 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger
17-04-18 13:59:09 INFO (MainThread) [homeassistant.setup] Setting up logger
17-04-18 13:59:09 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=78 from 2017-04-18 12:48:35)
17-04-18 13:59:09 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:09 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:09 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:09 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:15 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Office LED Strip Input Effect
17-04-18 13:59:15 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Office LED Strip Animation Speed
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Wind Direction, the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Tilt Sensor (Garage Door), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Door Sensor (Office Safe), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Wind Gust, the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Door Sensor (Front), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Thermostat (Upstairs), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Door Sensor (Kitchen), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Thermostat (Downstairs), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (Office), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Rain Intensity, the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (TV Room), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Wind Speed, the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Door Sensor (Ammo Safe), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (Kitchen), the state is unknown.
17-04-18 13:59:15 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Deadbolt (Kitchen), the state is unknown.
17-04-18 13:59:15 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:15 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:15 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:15 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: none. Expected: on, off, true, false
17-04-18 13:59:17 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (TV Room): UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
17-04-18 13:59:17 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (TV Room): UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
17-04-18 13:59:18 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (Office): UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
17-04-18 13:59:18 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template MultiSensor (Office): UndefinedError: 'mappingproxy object' has no attribute 'battery_level'
17-04-18 13:59:45 WARNING (Thread-6) [homeassistant.components.zwave] zwave not ready after 30 seconds, continuing anyway
So I’m just at a total loss here. Maybe I have something wrong with my logger config, which would explain why I’m not seeing logs on automations. Or maybe there was a breaking change on automations that I missed, and I’m just not seeing anything about it in the change logs.
Oh, and another very annoy thing that’s started happening, not sure if related or not, is hass seems to be constantly keeping 1 CPU core at 100%. I have hass running in a LXC under Proxmox, while the host server is a Dell R210 II (Xeon E3-1240v2 + 32GB RAM) with an Aeotec Z-Stick passed through to the LXC. LXC has 512M RAM (was 256), along with 2 vCPU cores. Is hass single threaded?
Here is a screenshot of htop. The reason this is an issue is that it causes the fans of the physical server to spin up a bit loud, especially for my home office where I may be on the phone with a customer. FWIW, these are NOT issues I had back in 0.36, or maybe even 0.38 (I can’t remember for sure).
Lastly, here is my full config. However, those configs haven’t been updated since early March. I keep my config updated to a local git repo, that I sanitize and push to github every so often. I’ve added sensors since my last github push, but things like my automation and scripts haven’t been updated in a while. In fact, switch_monitor_office.yaml
was originally committed to my local git repo on Jan 06, 2017 and hasn’t had any changes to it since. Likewise, the same is true with timer_office_monitor.yaml
script.
So yeah, not sure what other information I can provide here, but I’m having serious breaking issues with hass and I’ve not been able to figure out what’s going on. Usually if I restart hass, CPU usage immediately calms down, and will stay settled down for a while. In the meantime, I’ve increased my default logging to debug and will share that file once it fills up a little. I will update this post later with a link to a log dump.
Thanks for any assistance!