Thank you for all your support on how I should do things. But the fact is that your not very helpful in getting my problem solved. This discussion has taken a lot of time and I have other things to do that study home assistant. I will sort out my problem by reading in this forum. I thought to ask you tech guys since I thought it would not be a hard thing for guys in this forum to get me a quick answer, but I was wrong in stead of this you are lecturing me to go and learn Home Assistant programming. I thought the idea for this forum was to help people sort things out. I was wrong.
In the mean time I made a input boolean and going to figure it out by myself on how I can get this boolean to turn on the light and turn off the automation to turn off the light when no detection takes place. When switch off the boolean, turn of the light and turn on the automation again. .
The people here donāt work for Home Assistant, thatās an open source project. We are volunteering our free time to help others. Not all topics may get an answer, never mind one that helps you solve your problem.
Search
Itās not unlikely that your question has been asked, and answered, already. If you search the forum, you may find it and save yourself a lot of time.
Now, it may not be a perfect answer to your question, but it should get you close enough to start.
In fact, please read the whole thing and this too.
@snhnic I spent maybe hundreds hours by reading the docs and all the guys above answering you helped me tremendously. Try to be nice. Itās hard to understand HA but when you change the dark rabbit hole into enlihten one, you will realize what jewel you just found and what amazing work they done. You are not expected to be programming anything. Wishing you great journey!
The reaction of Vahaldor is a far better approach than the other reactions.
In my defense. It did read a lot about Home Assistant. Itās not a very friendly solution for home automation as far as I can see. I did spent a lot of time reading about it. I manage to get a lot of stuff working on my server, again Iām not a programmer, but proud to get the things done the way I like. Iām willing to learn as you all can see (I did get the code in like you asked), but really think the tone could be nicer, mine perhaps aswell. I donāt have an attitude @ all, I just like to say what I think.
The funny thing is that I sorted my problem and now have things working the way I want to.
Sorry to say that I now have a lot of coding for what I still believe could have been done with a script, it was nice when someone took the time to read the code (not formatted the right way, but seamless easy for you to put in the right formatting, what I could not - only way seems to click on </> -) instead of lecturing me.
Now I have ended up with 4 automatons and one input boolean, that I use to get the light on and off manually.
So okay itās not a helpdesk. I donāt think I get your definition of a helpdesk. Okay in my question your right, since there is no help. Happy enough there are lotās of others that have asked questions in this forum (with the right formatting ) so I was able to get answers. So many thanks to all the other help seekers that got the answers.
Well letās leave it with this and have a happy day. Again no hard feelings, but let us look in the mirror before judging. It;s all in the eye of the beholder.
Sorry to open an old thread but I have a similar situation and wanted to share some insight.
I had some success using āset_stateā instead of āservice.lights.turn_xā. This seems to modify reported state without it firing a changed state event. This was using appdeamon so your experience might vary.
On a similar and maybe relevant topic:
I have a similar system that has lights, movement sensors and a manual override.
The manual override is momentary with two buttons, on and off.
When there are two buttons it is very clear what you want the system to do.
My existing lovelace interface uses a pushbutton. The problem with a single pushbutton is that it does not know your real intention. All it can do is invert the existing state. This is kind of the reason I am looking through this thread.
Just found this momentary switch in HACS which might help out: hass-momentary github