Hello, i have got a lot of things working now.
I have window blinds tilt to close automatically when sun sets and open when sun rises.
I have a Bruh multi-sensor up and running.
Now i want to create an automation based on a lux value for the blinds to close and open.
But here is a catch. I don’t want to open the blinds when for instance a cloud goes over.
Because that could cause erratic behavior of the blinds.
The blinds need to close at lets say 900 lux but when a cloud comes the value will drop below that.
I want the blinds to stay closed for about 10 minutes. after it dropped below 900.
But if it goes over the 900 again the timer should stop, and only start counting again until it goes below 900 again.
This will prevent erratic behavior.
Only thing is that i have o clue on how to realize this, or if it is even doable.
My blinds function as light switches, on and of mode.
Might be more work then its worth but I would set up a 2ed Lux sensor in another room and have the blinds open and close biased on a average, I’m doing the same right now on temperature sensors and a window AC unit
Or perhaps in a automation set the trigger at the lux you want then in the conditions set a delay of one or two minutes then check the lux again to see if its still low then proceed with the closing of the blinds. The Delay should give enough time for the cloud to pass before closing the blind.
Obviously I don’t know the exact names of your entities, and I might have gotten open & close backwards (again, not knowing your specifics), but the general idea is, trigger the automation whenever the illuminance drops below 900, and stays that way for at least ten minutes (or use whatever time period you want), or raises to or above 900, and stays that way for the desired amount of time.
BTW, you might need some hysteresis to prevent the blinds going up and down because closing them makes the room darker, and opening them makes the room lighter, which could cause the sensor value to go back and forth across the one threshold (of 900.) I.e., you might need some separation between the below and above numbers (maybe below: 900 and above: 1500 or something depending on the sensitivity and resolution of your illuminance sensor.)
Thanks, this looks promising, i am going to try this and let you know how it works.
I have the sensor sitting between the blinds and the window, so the sun will keep shining on it even when the blinds tilt to close.
BTW, what I suggested effectively “filters out” short lux changes. Or to put that another way, effectively delays the response to lux changes. This, of course, is not what you originally asked for, but might be the better approach.
If you’d rather have the blinds change immediately, but want to implement a minimum period for staying in each state, that is also possible. (In fact, I do that with some lights I automate.) If you’d rather do that, let me know and I could make a different suggestion.
Oh, what the heck, here is how I do it for the lights on the front of my house. Oh, and BTW, sensor.illuminance is not a real light sensor. It’s a custom component I added that estimates outdoor illuminance based on the current weather conditions as reported by Weather Underground. And the DELAYED_HOMEASSISTANT_START part is to make sure that if I’ve had HA down for a while for some reason, or maybe power went our for a while, when it comes back up the lights will be set to what they should be (as if HA was running the whole time.)
- alias: Delayed Startup
trigger:
platform: homeassistant
event: start
action:
- delay: 00:00:15
- event: DELAYED_HOMEASSISTANT_START
# House Front based on:
# - Illuminance
# - Home Assistant start
- alias: House Front
trigger:
- platform: numeric_state
entity_id: sensor.illuminance
above: 999
- platform: numeric_state
entity_id: sensor.illuminance
below: 1000
- platform: state
entity_id: switch.house_front_lights
to: 'on'
for:
minutes: 30
- platform: state
entity_id: switch.house_front_lights
to: 'off'
for:
minutes: 30
- platform: event
event_type: DELAYED_HOMEASSISTANT_START
condition:
condition: template
value_template: >
{% if trigger.platform == "event" %}
true
{% else %}
{{ as_timestamp(now()) - as_timestamp(states.switch.house_front_lights.last_changed) > 30*60 }}
{% endif %}
action:
service_template: >
{% if states("sensor.illuminance")|int >= 1000 %}
switch.turn_off
{% else %}
switch.turn_on
{% endif %}
entity_id: switch.house_front_lights
This is exactly how i wish it should behave.
I am trying to set this op at this moment but i get an error.
Invalid config for [automation]: extra keys not allowed @ data[‘trigger’][0][‘minutes’]. Got None
offset None should be format ‘HH:MM’ or ‘HH:MM:SS’ for dictionary value @ data[‘trigger’][0][‘for’]. Got None. (See /config/configuration.yaml, line 117). Please check the docs at https://home-assistant.io/components/automation/
It depends what you’re trying to do. Assuming sensor.sn2_ldr only takes on integer values, then below: 900 and above: 899 effectively implements a single threshold. The automation will trigger whenever the value goes from 900 → 899 (because it went below 900) or from 899 → 900 (because it went above 899.) The threshold is effectively between 899 & 900.
If you were to use above: 900 and below: 899, then you would be implementing hysteresis. That is, the automation would trigger if the value of sensor.sn2_ldr went from 900 → 901, but then when it drops, it wouldn’t trigger until the value went from 899 → 898. (Same situation for the reverse scenario.) So the threshold for a rising value would be different than the threshold for a dropping value.
Normally i just lookup to what i need in the forums and that’s how i build my Home Assistant for over the past 2 years now.
Thinking about doing something back to the ha community i share my code here.
I was looking at this post for a while and yesterday i installed the KAKU Asun 650 blinds controller.
Now i already made some nice Bruh’s Multisensors also and was looking for a way to automate and mix them together.
I want to thank everybody in this post for helping me out. And i want to share my mixed configuration, that i have at the moment.
Great to see how someone else approaches this.
I am wondering how your light sensor works.
My problem is that mine registers the highest value of around 970.
It starts at that value at around 8 am these days and keeps that until 7 pm.
Only thing is that the sun stops shining at that window around 1 pm.
Normally i should see a lower value when there is no direct sunlight on the sensor i would think.
I think i need a sensor that can read much higher lux values.
I don’t have a lot of time at the moment, but I’m rebuilding the code a little for exactly the same thing you have.
At now the blinds will close when the sun comes up at a certain time. I am too struggling with the exact time of opening them again, when my upstairs spot is sun free at around 6 p.m. I will be back in a short period of days when I have right automation running.
About the Google pronouncing message…
It’s fairly easy to do and setup,
check…