#Paste in what you have if you can
1 messages ยท Page 1 of 1 (latest)
Hey my first thread! (yes, i'm a noob.)
Do you need to use the "illumance" type instead of numeric_state?
No not at all, numeric_state works perfectly, was more just because I'm curious how to parse float correctly if I would encounter something similar again ๐
Feels like I see different syntax in every thread I check
If you want to covert an entity into a float you would do it like this
{{ states('input_number.target_brightness_lux')|float(default=0) }}
but that will not work as expected, so I personally would use a Template trigger and then your trigger would look like this:
- platform: template
value_template: "{{ states('input_number.target_brightness_lux')|float(default=0) < 15 }}"
If you meant something different I apologize for not getting it. Let me know if I'm missing what you're saying.
(just edited it to add the < 15 part)
Ohh okay, template let's you write any condition freely?
Yes and if you do this a bunch, you get used to wanting to do things like that sometimes. The UI is good when trying to get used to things and such, but it does limit you once in awhile. I personal have just started moving basic stuff back from text files back into the UI and setting it up, but still find that I more often than not go into the 'Edit in YAML' screen and just make the changes myself. Sorry for long answer, but you may run into this in the future yourself.
Yeah I can imagine, I recently got started with home assistant but the UI does seem limiting sometimes, though it is nice to be able to test individual conditions and such from the UI
Sometimes it's just easier to quickly type something like this out:
trigger:
- platform: state
entity_id:
- input_button.test
- platform: template
value_template: "{{ states('input_number.target_brightness_lux')|float(default=0) }}"
condition: []
action:
- service: light.turn_off
data: {}
target:
entity_id: light.office_light
vs clicking a bunch of buttons to get to the same point in the end. ๐
(that's just random junk in there)
I can definitely see how I'll lean towards that as I get more experience
I only started using HA in April of 2021 so I'm fairly new too. Feel free to hit me up in the future if you want. I have to run and get some chores done. Take care.