Garage Door Up Alert Not Working

I think I have it setup correctly, but when the sensor says 255 which is what it takes for being in the “up” position, I don’t get an alert on my phone through the app

- id: '1589085567599'
  alias: Garage Door Open
  description: ''
  trigger:
  - entity_id: automation.garage_door_open
    for: 00:00:30
    platform: state
    to: '255'
  condition: []
  action:
  - data:
      message: The garage door is up
      title: Garage door is up
    service: notify.notify

Any help is appreciated

Here is my configuration.yaml if its needed

# Activate the configuration editor
config:

# Configuration.yaml example
automation: !include automations.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
#http:
#base_url: wadsley.duckdns.org:8123
#  ssl_certificate: 78e65fad-9879-4d30-916e-f2ec94cd929c
#  ssl_key: /ssl/privkey.pem

amcrest:
  - host: "192.168.1.110"
    username: XXXXXXXX
    password: XXXXXXXX
    port: "8080"



# Text to speech
#tts:
#  - platform: google_translate
#
#group: !include groups.yaml
#automation: !include automations.yaml
#script: !include scripts.yaml
#scene: !include scenes.yaml

Wrong trigger entity:

entity_id: automation.garage_door_open

That should be a binary sensor.

Wrong to: state.

to: '255'

That should be ‘on’ or ‘off’ not ‘255’

Thanks, that sensor wasn’t changing when I set this up last night, not is is, so I made the swap and it seems to be working.

Will I have to repair this and set it back up after I move my HA to its final locaiton? I seem to lose Z wave devices when I power down my HA

Is that the only device you have?

if no then do you have any other mains powered devices so they can create the mesh?

and I guess the other thing is do you still see the controller node after restart and are only losing the other paired nodes?

Its only that one device, and after a shut down I’m not sure I lose it like in a restart.

Still trying to figure that out, but haven’t verified it yet

If you only have one battery powered device then try to restart with the sensor in close physical proximity to the zwave stick ( right beside it would be best) and see if it comes back OK…and make sure you give it a few minutes to re-initialize everything.

I think I got it working with a power down, not a restart.

How do I setup my automation to have it so the lights only come on 15 minutes before sunset? Currently they come on all the time except at sunset / night

- id: '1589151804789'
  alias: Garage Lights After Dark
  description: ''
  trigger:
  - device_id: acb478166b17400e8783fa5616a4d6d7
    domain: binary_sensor
    entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    platform: device
    type: turned_on
  condition:
  - before: sunset
    before_offset: '-00:15:00'
    condition: sun
  action:
  - device_id: bcd5830564b84a25814151cef5d83a29
    domain: switch
    entity_id: switch.garage
    type: turn_on

Using the word “only” implies to me that you want the lights to come on “at 15 minutes before sunset” and at no other time. That sounds like a trigger not a condition.

Actually, the condition you have will allow the lights to come on all the time except between 15 minutes before sunset till midnight. So, if your binary sensor turns on any time from midnight till 15 minutes before sunset of that same day the lights will turn on. If the binary sensor turns on any time between 15 minutes before sunset until midnight of that same day then the lights won’t turn on.

Is that what you are seeing?

Yes, that is what I’m seeing, but its not what I want.

I want the lights to turn on only when its 15 minutes before sunset to midnight, not the other way around…

Then instead of using “before: sunset” use “after: sunset” and use the same offset.

I think I got it by changing things slightly, I followed the Sun directions from the HA page

- id: '1589151804789'
  alias: Garage Lights After Dark
  description: ''
  trigger:
  - event: sunset
    offset: -00:15
    platform: sun
  condition:
  - condition: state
    entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    state: 'on'
  action:
  - device_id: bcd5830564b84a25814151cef5d83a29
    domain: switch
    entity_id: switch.garage
    type: turn_on

Ok, again, I’m even more confused…

Setting the trigger the way you have it will turn on the light at exactly 15 minutes before sunset but only if the binary sensor is on at exactly the same time. If the binary sensor comes on even 1 second later the lights won’t come on.

That is more like when I said this:

but the reply to that post you said that you were seeing the opposite of the second part of my post:

You said that’s what you were seeing and wanted the opposite:

What you have now won’t do that.

it will act like the scenario in my first sentence above.

OK, so what setup should I use for the lights to turn on any time from 15 minutes before sunset to midnight, when the door sensor is turned on?

Is this setting it up like you recommended with the after susnet, and a -15:00 for 15 minutes before sunset?

- id: '1589151804789'
  alias: Garage Lights After Dark
  description: ''
  trigger:
  - device_id: acb478166b17400e8783fa5616a4d6d7
    domain: binary_sensor
    entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    platform: device
    type: turned_on
  condition:
  - after: sunset
    after_offset: '-15:00'
    condition: sun
  action:
  - device_id: bcd5830564b84a25814151cef5d83a29
    domain: switch
    entity_id: switch.garage
    type: turn_on

You already had it mostly right and I already told you how to fix it above.

Here is the whole thing with my fix:

- id: '1589151804789'
  alias: Garage Lights After Dark
  description: ''
  trigger:
  - device_id: acb478166b17400e8783fa5616a4d6d7
    domain: binary_sensor
    entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    platform: device
    type: turned_on
  condition:
  - after: sunset  #<--- this
    before_offset: '-00:15:00'
    condition: sun
  action:
  - device_id: bcd5830564b84a25814151cef5d83a29
    domain: switch
    entity_id: switch.garage
    type: turn_on

However, that assumes all of the other syntax and entities are correct.

I don’t use the automation editor or use any device automations so I can’t really know for sure what the required syntax there is but from what I do know it looks OK.