Late reply but anyway - The value (load power) was parsed correctly from the syntax you suggested (I also used it to create a sensor), but I still couldn’t get the trigger to fire off - so I rewrote it as below, and now the trigger fires off correctly:
I’ve said on the post why it’s not as a condition, see the commented code. The problem is that the var num doesn’t persist inside the FOR loop. If you know a way, let us know.
condition:
condition: template
value_template: >
{% for state in states.binary_sensor if state.attributes.battery_level and state.attributes.battery_level | int < 10 %}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{% endfor %}
That’s a good way to approach the problem, it should work!
- alias: Notify when the battery_level is low
trigger:
condition:
condition: template
value_template: >
{%- for state in states.binary_sensor if state.attributes.battery_level and state.attributes.battery_level | int < 10 -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
action:
service: notify.slack_general
data_template:
message: >
{%- for state in states.binary_sensor -%}
{%- if loop.first %}Devices with battery level low: {% endif -%}
{%- if state.attributes.battery_level -%}
{%- if state.attributes.battery_level | int < 10 -%}
{{ state.name }}-{{ state.attributes.battery_level }}%;
{%- endif -%}
{%- endif -%}
{%- endfor -%}
Ok plus me in to the 149 update (maybe).
Or a 0.51 update (were there any changes from 0.50?)
Running successfully since dec 2016. Yesterday had a major crash updating HA to 0.51.2. Everything went fine. Issued reboot and that’s it. As i’m running raspbian and SSH refused connections - all i could do reinstall.
Went once again with All in one installation. gited in the configs and…
Xiaomi component is working erratically. Sometimes sensors work. Sometimes they don’t. Nothing in the logs (of interest).
In config i have something like below. Any recommendations? Maybe there is way to go back to 148FW?
xiaomi:
gateways:
- mac:
key: some_key
P.S. By the way since december - all my motion sensors (10pcs) have 40+ battery
Having trouble figuring out under which ringtone_id my new custom recordings are going. Previously I could find the custom ringtones starting at ringtone_id 10001 and going up by 1 for each new recording. Not sure if it is the latest firmware, but they no longer seem to be going up from there.
My last successful custom ringtone ended at 10013, but I cannot reference new ringtones after that. I have tried 10014 - 10030 and can not get them to play. My previous custom recordings still are accessable at the lower ringtone_id numbers.
I am on firmware 1.4.1_149.0143 - seems like new custom recordings does not work anymore - at least to be able to find the ringtone_id. Prior to this firmware, new recordings started at 10001 and each new recording went up from there. I am unable to find any new recordings.