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 .
’
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:
“Properly format the code”: quite simple. Put reverse single quotes (the key next the 1) like this ``` before and after the code. Then it looks like this:
# zoom lighting on & off
- alias: 'zoom lighting on'
trigger:
platform: state
entity_id: input_boolean.zoom_lighting
to: 'on'
action:
- service: script.turn_on
target:
entity_id: script.zoom_lighting_on
Why do we request that you do that?
It makes it easier for us to read and thus help you debug it.
It means you can just copy and paste the code and it should be indented correctly
Sorry but I tried it but if your not willing to help me unless I format thing properly. Well delete my post and I will learn your rules and ask again if I get the right way to ask. Something are easy for U guys… not for me. Strange attitude??? Well guess that’s me.
If you can’t learn the difference between a back tick ` and a quote ‘ then I’m not sure how you’ll get home assistant working. You’re really make a big deal out of nothing. Use 3 backticks before your code and after and it will be formatted.
as it seems you are all taking the time to tell me I’m not formatting the way you want me to do code. It’s a simple code, not very long. Perhaps someone is willing to help me instead of burning me to the ground, telling me about my attitude. I like to delete my question, please if not for the code tell me how to delete this. By the way I did try the ‘’’ it just did not work, perhaps some PC settings.
It doesn’t matter how simple it is. If it looks like this we can’t help you:
So read this, edit your post instead of complaining and then maybe someone will help you.
Spacing is critical in YAML, and if you just throw the code on the page then it’ll look ugly and nobody will know if the problem is because of spacing. We need you to use code blocks and appropriate markup.
For example, this is easy to read and it is obvious if the spacing is correct:
# Turn off lights when everybody leaves the house
- alias: 'Rule 2 - Away Mode'
trigger:
platform: state
entity_id: group.all_devices
to: 'not_home'
action:
service: light.turn_off
entity_id: group.all_lights
This however, not so much:
Turn off lights when everybody leaves the house
alias: ‘Rule 2 - Away Mode’
trigger:
platform: state
entity_id: group.all_devices
to: ‘not_home’
action:
service: light.turn_off
entity_id: group.all_lights
Full details are in that link , but in brief you wrap your block in three backticks (```)
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
Well that’s just the thing. Before I can get to my problem I’m way of to read and read and read how to ask a question. But after all this still no solution to my original problem. For you as an moderator it is an easy thing, but as I already told I’m not doing this on a daily basis. I’m not a programmer and have no intention to become one. I just want to have some automation in my home without the Chinese to see if I turn on a light. The reason I come to this forum to get some help achieving this. I hope you get my point of view,
No hard feelings or anything, but the point of this forum is not to create your HA config on your behalf.
You are supposed to read and study and learn how HA is working so that you can tailor it to your requirements.
If you’re not ready to read the abundant documentation and search the forum for similar questions and answers, HA will stay obscure to you and you will have a really hard time getting somewhere.
Sorry to tell you, but automations are basically programs…
If you hate it, maybe check Node Red, it’s a more graphical way to build tour automations (but still, you will have a lot to learn).