Hi guys, I’m not very expert in hassio but by reading and searching in the community I tried to create an automation to turn the cameras on/off when one of the family members is at/from home using the zone and the WIFI SSID.
Using only the zone parameter the automation works correctly.
The problem is that by integrating the sensor that I created for each smartphone the automation does not work and does not turn the cameras on/off even if the sensor takes the correct home/non-home value for each smartphone based on the WIFI SSID.
I’ll send you the configuration files.
Can someone help me?
Thanks in advance
sensor.yaml
- platform: template
sensors:
cellulare_m2007j3sy_home:
unique_id: cellulare_m2007j3sy_home
value_template: >-
{% if states(‘sensor.cellulare_m2007j3sy_wifi_connection’) == “Home” or states(‘sensor.cellulare_m2007j3sy_wifi_connection’) == “Home-5G” %}
home
{% else %}
not home
{% endif %}
friendly_name: ‘Cellulare M2007J3SY Home (SSID = Home)’ - platform: template
sensors:
cellulare_m2007j3sy_home_2:
unique_id: cellulare_m2007j3sy_home_2
value_template: >-
{% if states(‘sensor.cellulare_m2007j3sy_wifi_connection_2’) == “Home” or states(‘sensor.cellulare_m2007j3sy_wifi_connection_2’) == “Home-5G” %}
home
{% else %}
not home
{% endif %}
friendly_name: ‘Cellulare M2007J3SY Home 2 (SSID = Home)’ - platform: template
sensors:
cellulare_sm_a336b_home:
unique_id: cellulare_sm_a336b_home
value_template: >-
{% if states(‘sensor.cellulare_sm_a336b_wifi_connection’) == “Home” or states(‘sensor.cellulare_sm_a336b_wifi_connection’) == “Home-5G” %}
home
{% else %}
not home
{% endif %}
friendly_name: ‘Cellulare SM-A336B Home (SSID = Home)’ - platform: template
sensors:
cellulare_m2007j20cg_home:
unique_id: cellulare_m2007j20cg_home
value_template: >-
{% if states(‘sensor.cellulare_m2007j20cg_wifi_connection’) == “Home” or states(‘sensor.cellulare_m2007j20cg_wifi_connection’) == “Home-5G” %}
home
{% else %}
not home
{% endif %}
friendly_name: ‘Cellulare M2007J20CG Home (SSID = Home)’
groups.yaml
famiglia:
name: famiglia
icon: mdi:home-heart
entities:
- device_tracker.cellulare_m2007j3sy
- device_tracker.cellulare_m2007j3sy_2
- device_tracker.cellulare_sm_a336b
- device_tracker.cellulare_m2007j20cg
- sensor.cellulare_m2007j3sy_home
- sensor.cellulare_m2007j3sy_home_2
- sensor.cellulare_sm_a336b_home
- sensor.cellulare_m2007j20cg_home
automations.yaml
- id: ‘1682530973040’
alias: Siamo in casa
description: Se uno di famiglia è in casa disattiva le telecamere
trigger:- platform: state
entity_id:- group.famiglia
to: home
condition: []
action:
- group.famiglia
- type: turn_off
device_id: 1e4720480958a6f5de12a2f1cb67b947
entity_id: switch.sonoff_10005e0f93
domain: switch - type: turn_off
device_id: 4eae1bc18820531c6fe68eda488aa181
entity_id: 10e14b9c3224263362d0dbce4b6a676e
domain: switch
initial_state: ‘true’
mode: single
- platform: state
- id: ‘1682531097600’
alias: Siamo fuori casa
description: Se siamo tutti fuori casa attiva le telecamere
trigger:- platform: state
entity_id: group.famiglia
from: home
condition: []
action: - type: turn_on
device_id: 1e4720480958a6f5de12a2f1cb67b947
entity_id: switch.sonoff_10005e0f93
domain: switch - type: turn_on
device_id: 4eae1bc18820531c6fe68eda488aa181
entity_id: 10e14b9c3224263362d0dbce4b6a676e
domain: switch
initial_state: true
mode: single
- platform: state
- id: ‘1682616564293’
alias: Entrata
description: Se uno di famiglia è in casa disattiva le telecamere
trigger:- platform: numeric_state
entity_id: zone.home
above: 0
condition: []
action: - type: turn_off
device_id: 1e4720480958a6f5de12a2f1cb67b947
entity_id: switch.sonoff_10005e0f93
domain: switch - type: turn_off
device_id: 4eae1bc18820531c6fe68eda488aa181
entity_id: 10e14b9c3224263362d0dbce4b6a676e
domain: switch
initial_state: ‘true’
mode: single
- platform: numeric_state
- id: ‘1682616277552’
alias: Uscita
description: Se siamo tutti fuori casa attiva le telecamere
trigger:- platform: numeric_state
entity_id: zone.home
below: 1
condition: []
action: - type: turn_on
device_id: 1e4720480958a6f5de12a2f1cb67b947
entity_id: switch.sonoff_10005e0f93
domain: switch - type: turn_on
device_id: 4eae1bc18820531c6fe68eda488aa181
entity_id: 10e14b9c3224263362d0dbce4b6a676e
domain: switch
initial_state: ‘true’
mode: single
- platform: numeric_state