Automation how to?

Hi All,

After having the mysensors gateway and a node configured and working, it’s time to start the automations.

my mysensors-1.json file:

{
    "0": {
        "sensor_id": 0,
        "children": {},
        "type": 18,
        "sketch_name": null,
        "sketch_version": null,
        "battery_level": 0,
        "protocol_version": "2.3.2",
        "heartbeat": 0
    },
    "1": {
        "sensor_id": 1,
        "children": {
            "1": {
                "id": 1,
                "type": 0,
                "description": "",
                "values": {
                    "16": "0"
                }
            },
            "2": {
                "id": 2,
                "type": 0,
                "description": "",
                "values": {
                    "16": "0"
                }
            }
        },
        "type": 17,
        "sketch_name": "Door Window Sns x2",
        "sketch_version": "1.0",
        "battery_level": 0,
        "protocol_version": "2.3.2",
        "heartbeat": 0
    }
}

Logbook shows:

6:02:49 PM Door Window Sns x2 1 2 is closed
6:02:49 PM Door Window Sns x2 1 2 is opened
6:02:48 PM Door Window Sns x2 1 2 is closed
6:02:44 PM Door Window Sns x2 1 2 is opened
6:02:43 PM Door Window Sns x2 1 2 is closed
6:02:41 PM Door Window Sns x2 1 2 is opened

Creating automation:

Create a new automation
Type below what this automation should do, and we will try to convert it into a Home Assistant automation. (only English is supported for now)

For example:
Turn off the lights when I leave home
Turn on the lights when the sun is set
Notify me if the door opens and I am not at home
Turn the light on when motion is detected
 
What should this automation do?
Notify when door is open
Powered by Almond

By next, it shows:

Great! Now we need to link some devices.
Trigger:
 
Add Binary sensor, cover of type door device

Just could not find what to add… anything i try to enter is not accepted.

Any hint?

Thx in advance.

What entity_id is the mysensors id?

binary_sensor.door_window_sns_x2_1_1

Name                                 Entity ID                                                         Integration
Door Window Sns x2 1 1   binary_sensor.door_window_sns_x2_1_1     Binary sensor
Door Window Sns x2 1 2   binary_sensor.door_window_sns_x2_1_2     Binary sensor

but when i enter it on TRIGGER i the following notice.

Trigger:

Add Binary sensor, cover of type door device

i can’t go on…

I assume your trying the automation editor ? In the first dialog, click on ‘skip’

Under entity simply enter binary_sensor.door_window_sns_x2_1_1

Ok, thank you!

now i have:

/var/homeassistant/homeassistant# cat automations.yaml 
- id: '1594482997857'
  alias: door open not home
  description: notify when door gets open and i'm not home
  trigger:
  - entity_id: binary_sensor.door_window_sns_x2_1_1
    for: person.paulo
    from: 00:00
    platform: state
    to: '23:59'
  condition:
  - condition: device
    device_id: f9257c8746ed44108102791ac56c1eff
    domain: device_tracker
    entity_id: device_tracker.iph6pw
    type: is_not_home
  action:
  - condition: state
    entity_id: binary_sensor.door_window_sns_x2_1_1
    state: open

what i want:
whem i’m not home, reported by device_tracker.iph6pw, and door with sensor binary_sensor.door_window_sns_x2_1_1 i want to get notified on my phone device_tracker.iph6pw, being person person.paulo, anytime of the day. i don’t know if this is right at automations.yaml

are there examples of automations where i could get better info? the ones by docs are not that good for a beginner…

thx in advance for any help and guidance…

There are examples all over the forum.

But in this case

^ your trigger foesn’t need all that time stuff, your trigger should just be the door opening

  • your action should be a notify service.