I want to get a notification via email if my garage door is open for 10 minutes. I have a Wemo Maker with the sensor attached. I am having problems figuring out the code for this. So far I have this:
thanks for the reply, i guess what I am having trouble with is that the wemo maker is a switch, but also has a sensor as well. The sensor doesnt show as an entity in HA so its not clear how to get the sensor state from the wemo maker inside HA. Here is what I tried recently:
the notifications work as i have tested it with a simple automation. In the wemo app, the sensor is âtriggeredâ or ânot triggeredâ so maybe the state I have is not right? I am using the only info I have seen to help with this: Redirecting to Google Groups
You can only enter entity_ids as value for the entity_id key in the automation. It looks as if youâre trying to enter a template there right now. If you want to access a state attribute (sensor_state) and use that as trigger you can look at the template trigger:
The alternative is to add a template condition that checks the state attribute:
If you go to the developer tools section state, and click on the entity you will see all the state attributes. If you want more specific help, please post that info here.
I think you want something like this because state.switch.garage_door.attributes.sensor_state doesnât evaluate as a state but rather just a string so your trigger is never âtrueâ
- alias: Garage Door Open
trigger:
platform: template
value_template: "{% if states.switch.garage_door.attributes.sensor_state=='off' %}true{% endif %}"
for:
hours: 0
minutes: 10
seconds: 30
action:
service: notify.garage
data:
title: "Garage is OPEN"
message: "GARAGE IS OPEN"
Alternatively a better option may be to make a template sensor as this will allow you to display the garage door state on your dashboard as well as use it as a trigger for your automation.
As an aside the physical install of the maker for this application was very easy. Iâve got the makerâs relay in parallel with the original opener button and used a magnetic reed switch on the door connected to the makerâs sensor input.
I also put a camera in the garage so I can check for obstructions if closing it remotely.
Already had one nice win moment when a courier called me while I was out and I remotely let them into the garage to leave the new TV and watched the whole thing on my phone.
Thanks @mrtips Iâm also using the wemo maker with my garage door. Iâm new to HASS, might you help me with this scenario below.
My wemo maker appears on the HASS dashboard as a switch named âGarage Doorâ and operates in momentary switch mode. Iâd like to create a template switch so that the HASS dashboard shows the state of the Garage Door and Iâll hide the wemo maker switch after I get it working properly. Iâm following this guide https://home-assistant.io/components/switch.template/ My code is as below:
This code worked beautifully. One thing I had to edit was the fact that Automations has been moved to a seperate .yaml. I opted to use automation old to solve this. Then I combined that with Pushbullet to notify me:
automation old:
#Garagedeur
- alias: Garage Door Alert
trigger:
platform: state
entity_id: sensor.garage_door_state
to: 'open'
for:
hours: 0
minutes: 10
seconds: 30
action:
service: notify.garage
data:
title: "Garage Door Open"
message: "Garage Door is still open"
#Notify
notify:
- name: garage
platform: pushbullet
api_key: GETFROMPUSHBULLET