I like to have an normal on/off switch in lovelace that make the light go on and when activated turn off again. But my automation turns it off again when there is no motion. How can I achieve that when pushed on in lovelace it stays on untill I pushed it off again. Some override the no motion automation .
below my automation detect motion turn on light and when no motion trun off light. Hope I did it right.
By the way I now used </> in the edit from edge, when I do the suggested ‘’’ the formatting does not work. Perhaps something to be aware of before burning people who do not program for a living or don’t do this very often. Just saying we are not all the best. Sorry if it seems an attitude, but I did try to do it the way suggested, it just did not work,
alias: Detect motion on patio turn on light
description: ''
trigger:
- platform: state
entity_id: binary_sensor.camera_patio_motion
from: 'off'
to: 'on'
condition: []
action:
- device_id: dbc313e75cc72b985ef376c2b2cf821e
domain: mobile_app
type: notify
message: Motion detected on Patio
data:
push:
sound: Notification_Haptic.caf
title: ''
- type: turn_on
device_id: eb57cda6b656e777857e9408197a3b2f
entity_id: light.dimmable_light_28
domain: light
brightness_pct: 50
mode: single
And the automation section to turn the light off again
alias: Detect no motion on patio turn off light
description: ''
trigger:
- platform: state
entity_id: binary_sensor.camera_patio_motion
from: 'on'
to: 'off'
condition: []
action:
- type: turn_off
device_id: eb57cda6b656e777857e9408197a3b2f
entity_id: light.dimmable_light_28
domain: light
mode: single