This shows the group with icon image on the frontend, so far so good.
If either BT or ios is home, the status / zone changes to ‘home’.
I’ve made multiple zones.
The BT component always shows ‘away’, when not home.
The ios component is set to the according zone when entered (for example ‘Work’)
To clarify:
Now: I want to set the zone of the whole group, if the ios component changes to f.e. ‘Work’
Can anyone help with this? I think i must put a few conditions into automations.
But can’t seem to get this to work.
So you’ll get the bluetooth away/home resolution needed for home automation when home, and the sensor will display whatever your IOS stuff when absent. You may need to tweek the code if you get unwanted ‘leaving’. Maybe something that checks if your IOS device is still home when the bluetooth says your away:
Petro, thanks for the reply!
Going to test it out this evening, now at work
A few questions: (still new to HA)
Does the sensor replace the group? (device_tracker.rick_bt & device_tracker.rick_ios)
Or will it ‘link’ the sensor to device tracker group with;
sensors:
device_tracker_rick:
value_template: >
Wouldn’t it be the other way around?
{% if is_state(‘device_tracker.rick_ios’,‘Afwezig’) and states(‘device_tracker.rick_bt’) != ‘Home’ %}
{{ states(‘device_tracker.rick_bt’) }}
{% elif is_state(‘device_tracker.rick_bt’,‘Afwezig’)} {{ states(‘device_tracker.rick_ios’) }}
{% else %}
{{ states(‘device_tracker.rick_bt’) }}
{% endif %}
it won’t on it’s own, you’ll have to do that yourself, or add it to the group. Its a completely new sensor in addition to your group and other device_trackers. If you are using the group in automations, replace the group with the sensor in the automations.
I don’t think so, the IOS reports slower than the bluetooth will. So the ios will always be lagging behind the bluetooth sensor. So use the bluetooth as the primary and the ios as the secondary.
The way these show in the frontend is not the same as the actual states. For device_tracker’s, the states are actually ‘home’ and ‘not_home’ (and sometimes they may be the name of a zone. At least that’s what I’ve experienced with them, but I haven’t used these same device tracker platforms.) So you probably want this instead:
{% if is_state('device_tracker.rick_bt','not_home') and not is_state('device_tracker.rick_ios','home') %}