I’ve been struggling with overlappings zones. I haven’t found any topics related to this, but surely someone else would like to have nested zones / hierarchy (parent-child) in zones ?
The problem:
I have one big zone called “near area”, which is about 20 km radius from my home. There is also some smaller zones inside that area, like shopping centers.
I have some automations which are based on whether anyone is in home or “near home”. Example turn on the towel heater in the evening. Now the problem with this is, that if we are in the shopping center when automation is run, automation does not turn on the heater, because we are in the shopping center zone, not in the near area zone. Eventough these two zones do overlap.
I can circumvent this by checking all the zones in the automation. But this makes it really difficult to maintain. Everytime I add new zone inside the near area, I need to add it to multiple automations also. If I could add zone inside/under another zone, it would be automatically considered in all automations where I have added the parent zone.
Now my automation is this:
alias: Turn on Towel heater
triggers:
- trigger: time
at: "18:40:00"
conditions:
- condition: or
conditions:
- condition: numeric_state
entity_id: zone.near
above: "0"
- condition: numeric_state
entity_id: zone.home
above: "0"
- condition: numeric_state
entity_id: zone.lielahti
above: 0
- condition: numeric_state
entity_id: zone.veska
above: 0
- condition: numeric_state
entity_id: zone.elo
above: 0
- condition: numeric_state
entity_id: zone.kaleva
above: 0
actions:
- type: turn_on
device_id: xxx
entity_id: xxx
domain: switch
mode: single
When ideally there could be only one condition, if all the zones could be marked as a child for near area.
