Wemo Maker Sensor notifications

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:

`notify:
name: garage
platform: smtp
server: smtp.gmail.com
port: 465
sender: SENDER_EMAIL_ADDRESS
starttls: 1 or 0
username: [email protected]
password: *********
recipient: [email protected]
automation:

  • alias: Garage Door Open Too long
    trigger:
    platform: sensor_state
    entity_id: state.switch.garage_door.attributes.sensor_state== “off”
    for:
    hours: 0
    minutes: 10
    seconds: 30
    action:
    service: notify.garage
    data:
    title: “Garage is OPEN”
    message: “GARAGE IS OPEN”`

ANyone using a wemo maker and the sensor states? Any help would be great. thanks.

I havent found much anywhere else online, anyone use Wemo Maker and the sensor with HA?

The platform and entity_id in the automation are wrong at least. See:

Check the developer tools section states to find the correct entity_id of your garage door.

Please post config within code block markdown in the forum. That’s three back-tics, newline, code, newline, three back-tics.

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:

automation 3:
alias: test
condition:
platform: state
entity_id: state.switch.garage_door.attributes.sensor_state
state: ‘off’
for:
hours: 0
minutes: 0
seconds: 5
action:
service: notify.test
data:
title: “door open”
message: “door opennn”
target: J_iPhone

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

so far no reply from the OP in the above link.

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.

Thanks, i think you have got me closer to the right result, I just dont know what I have done wrong…

automation 3:
alias: test
trigger:
platform: template
value_template: “{% if is_state(‘state.switch.garage_door.attributes.sensor_state’, ‘off’) %}true{% endif %}”
condition:
condition: template
value_template: “{state.switch.garage_door.attributes.sensor_state == ‘off’}”
for:
hours: 0
minutes: 0
seconds: 5
action:
service: notify.test
data:
title: “door open”
message: “door opennn”
target: J_iPhone

Im a complete noob at this stuff, but once i see it, i can reproduce going forward. Im not sure if i am using the templates correctly…

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.

Just to satisfy my need for completion I knocked up this test, which works:

sensor:
  - platform: template
    sensors:
      sofa_lamp_state:
        value_template: >-
          {%if states.light.sofa_lamp.state == 'on' %}
            glowing
          {%elif states.light.sofa_lamp.state == 'off' %}
            dark
          {% else %}
            unknown
          {% endif %}
        friendly_name: 'Sofa Lamp State'


automation:
  - alias: Light On Alert
    trigger:
      platform: state
      entity_id: sensor.sofa_lamp_state
      to: 'glowing'
      for:
        hours: 0
        minutes: 0
        seconds: 30
    action:
      service: notify.pushover
      data:
        title: "Lights are on"
        message: "Sofa Lamp is still on"

so i believe your code should be as follows (I have a Wemo Maker on the way so I’ll test when it arrives).

sensor:
  - platform: template
    sensors:
      garage_door_state:
        value_template: >-
          {%if states.switch.garage_door.attributes.sensor_state == 'on' %}
            closed
          {%elif states.switch.garage_door.attributes.sensor_state == 'off' %}
            open
          {% else %}
            unknown
          {% endif %}
        friendly_name: 'Garage Door State'

automation:
  - 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"
1 Like

Any luck? Can you confirm that the wemo maker sensor states work.

I’ve 2 wemo makers and would like to do this myself.

Yes I can confirm this works. I’m using pushover to get notifications after 10 minutes.

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.

1 Like

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:

switch:
  - platform: template
    switches:
      testgdtemplate:
        value_template: '{{ states.switch.Garage_Door.attributes.sensor_state == "off" }}'
        turn_on:
          service: switch.turn_on
          entity_id: switch.testgdtemplate_open
        turn_off:
          service: switch.turn_on
          entity_id: switch.testgdtemplate_close

What is working:

  • the new switch named “testgdtemplate” shows up on the HASS dashboard
  • testgdtemplate" displays as ON when my gararge door is open (Garage_Door.attributes.sensor_state == “off”)
  • “testgdtemplate” displays as OFF when my gararge door is closed (sensor on wemo is on at this time)

Can you help with the following:

  1. I can’t make “testgdtemplate” actually activate the wemo switch named “Garage_Door”. Might you help?
  2. How do I grant a friendly name to “testgdtemplate”? For example, how do I call it “Test Garage Door Template”?

Thanks in advance!

I’ve solved both of the questions I asked.

  1. I realise that entity_id represent the actual switch I wish to activate. I’ve changed to “switch.garage_door” which represents the wemo switch
  2. I looked at your previous code for “friendly_name:” and understand how it now works.

The working code for my template switch looks like this now:

switch:
  - platform: template
    switches:
      testgdtemplate:
        value_template: '{{ states.switch.Garage_Door.attributes.sensor_state == "off" }}'
        turn_on:
          service: switch.turn_on
          entity_id: switch.garage_door
        turn_off:
          service: switch.turn_on
          entity_id: switch.garage_door
        friendly_name: 'Garage Door Template'
2 Likes

Sorry I didn’t get back to you I’ve been off the grid for a while over Christmas. Glad you got it sorted.

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