#What’s the automation? I’m too lazy to
1 messages · Page 1 of 1 (latest)
lol what? I didn’t do nothing.
f'in POS
Are you using a code paste site?
i was trytin to put it here as a file
Please use a code share site to share code or logs, for example:
- https://dpaste.org/ (select YAML for the language, and consider picking a longer expiry)
- http://pastie.org/ (select YAML for the language)
- https://paste.debian.net/ (you guessed it, select YAML as the language)
Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.
Wow… you’re taking the long way round, huh? Ok, so what’s breaking?
so the issue atm is that the lights are turning on to the initial setting
but they arent getting set to the running value
line 47
works
52-59 is where (I think) the issue is
Ok. Give me a sec.
sure!, i appreciate you looking
Line 59: states['binary_sensor should be states('binary_sensor
Also occupancy'] should be occupancy')
ok lemme see where that is
Line 59 😊
ohhhhh yeah. Lol gotcha.
Just switch to YAML editing in the UI and edit those two and it should work.
its not a visual automation ... did all this by hand lol
Ahhhh. So, line 90, same problem. And there are others further down too.
so i had 4 of those
Yup
changed them, let's give it a whirl
Actions: Unexpected value for condition: 'None'. Expected and, device, not, numeric_state, or, state, sun, template, time, trigger, zone @ data[0]['if'][1]
wtf
forgot "then:"
smh
lol
ok
same prollem
comes on at 1% (configured) but doesnt get brighter
hard to do a trace on it too, since frigate floods the crap outta mqtt
True. Is there any reason you’re not using the frigate integration and using the binary_sensors?
multiple cameras and lights
specifically:
var:
frigate_lighting_monitor6_lights:
initial_value:
- light.craftroom_lamp
attributes:
friendly_name: "[Frigate Lighting] Controlled Lights"
restore: false
Ok, so correct me if I’m wrong, you’re trying to use the cameras like presence sensors?
different cameras control different lights when a person is in the room
yep
exactly
Got it. Ok. Let me get on a bigger screen.
I'm open to screenshare / audio too if it helps
Nah. I’ll get it. Just need to see it on something bigger than my phone.
that way you can see more than what I can paste and/or I can tell you verbally how its supposed to work in my head
lol
you'll need the 'camera' config too, lemme send that to dpaste too
Oh, I get what you’re trying to do (buy a damn motion sensor!!!).
Ok, so, try this… in the template editor, try this:
(I also have 4 cats, so 'motion' is going to set it off all the time)
{% set topic = ‘[your topic]’ %}
{{ (now() - timedelta(seconds=states('input_number.frigate_'~topic.split('/')[0]~'_timeon_duration')|int)) > states('binary_sensor.'~topic.split('/')[0]~'_person_occupancy').last_changed }}
Oh wait… hmmmmm
Check out my edit.
UndefinedError: 'str object' has no attribute 'last_changed'
i think thats why i had the square brackets
yep
Try this: state_attr(‘binary_sensor.'~topic.split('/')[0]~'_person_occupancy' ,’last_changed’)
{{ state_attr('binary_sensor.'~topic.split('/')[0]~'_person_occupancy' ,'last_changed') }} returns null
hangon
And you set it to a topic, right?
What topic did you use?
frigate/monitor6
Oh I get it. Been there, done that.
ok so problem is still the same,
but the light still comes on
so not going backwards
Yeah, it’s something with this template… just need to figure out what.
omg
What does that binary sensor show in States?
LMAO
Only you would know… I don’t know how those sensors are named.
Ah crap. You’re right.
So, it would be binary_sensor.monitor6_xxx
Ok so wait… it was literally a 0, 1 problem?!
let me turn it down to 50 and make sure that im not losing my fin mind
honestly, i think maybe
but Im not sure I want to admit that
And here I thought this was a quick 5 minute fix. lmao
Isn’t that the desired result?
yes and no
light on @ initval, wait n seconds, check if person is still there, if yes, raise to runningval
well,
not 'wait'
Line 56. Change 0 to 1?
All of them. Should be 1, I think
youre right
but it still goes to runningval, not init
right off the bat
so
hmm
alright lemme paste the whole damn thing real quick
maybe you'll catch something I didnt
Ok. So, I don’t see where the input_number is being set or any increase to the brightness_pct. Let me look again.
Right. But, what I mean is, there’s no service call to raise or lower the brightness_pct. So, they trigger on the topics and all that, but there’s nothing that increases or decreases brightness. Am I missing that?
Which line?
So, you have the repeat, but the input_number never changes, so it’s just setting the same value over and over.
Right… but, the initial value is 50%, but there’s nothing in the automation that changes that.
Ahhhhh ok, NOW I SEE IT
Ok, so the initial is 10% and should go to 50%. Right? And right now it goes straight to 50%?
right
So, here’s what I’m thinking… it IS starting at 10%, but then very quickly, it jumps to 50%. So, maybe it appears like they are turning on at 50%, but in reality 2 commands are sent back to back. Do your bulbs support transitions?
yes and no... it does it by default
but officially, it just goes to 100%
but it steps
Hmmmm maybe throw a delay of like 2 seconds after the initial turn_on might help here.
Ok 😊
ok so I got the lady tucked in
taking another look at what is supposed to happen 1st, make sure I have the right values
Ok.
That’s the only thing I can think of at this point.
I wonder if it’s the last_changed. It was coming up as None in the template editor, right?
hmm yeah
changing it to 'states['binary_sensor.'~topic.split('/')[1]~'_person_occupancy'].last_changed' on the templater yields a value
Huh, yeah, I was wrong about that. But, I use state_attr for those kind of things. Ok, try changing it back and see if it works better?
im gonna throw some stops in
see just where the hell this thing is being stupid
its '- stop "reason", i think?
- stop: reason
lol yup. Same.
ok
made some debug progress
lines 47-49 are garbage
as_datetime returns null
because 12:00:00 is a str
not an actual date
Huh, so, probably need a strptime there as well.
I'd thought you might like to know ... i tinkered with this a little more last night and ended up just going to bed
but now this morning the light is behaving the way it should
🤷
alright, so whatever I possibly figured out last night is actually working. correctly
thanks for your help last night
Yay!!! That's awesome. That's a beast of an automation. lol
hey, can I DM you real quick?