No, I didnât read, it was night for me, sorry, so I just told you I would check this tomorrow. As itâs not really ergonomic explaining the context with a phone interface, letâs do it now with my PC.
This extract of code is used to manage an external solar blind, I mean for solar protection, to protect overheating inside the house (most of the time, end of spring, autumn, and part of the summer). But in winter, this blind is up, allowing heating almost the whole house. This house is based on passive (constuction, windows) and active sun energy (thermal solar and photovoltaĂŻc).
Ok, thatâs said. Now my problem, as I say, this is an external blind, sensible to high wind, I mean if wind is higher than 30km/h, blinds goes up, thatâs easy because local meteo station where Iâm connected via swissmeteo custom_component is very accurate with wind measurement. Blind could be destroyed in case of storm.
Now you could say, why donât you manage your blind also according to the meteo station data, like âlightning, rainy, stormâ? Because I must say, this is totally inacurate. Letâs say for example meteo indication is Lightning, thatâs mean, a sequence of sun and clouds in a certain frequency. For example 10 minutes of sun, than 10 minutes of clouds and so on. Are you still reading? ![:grin: :grin:](https://community.home-assistant.io/images/emoji/twitter/grin.png?v=12)
So my solution is to use the photovoltaĂŻc power sensor that gives me very accurate data about luminosity, and more reactive than my external luminance z-wave sensor battery based. My goal is to allow the blind to goes down and up one time per day, so I handle it wiht a flag. Because I do not want the blind to goes up and down 10 times per day. But what do I want to do with my "For â00:05:00â? This is just to filter the extreme or error value. For example I set my pwpower limit to 400W, that means ok, If < 400W very cloudy, blinds Up But as I explained above, this could be a cycle, so may be five minutes later, sun is back, and in summer this will be a problem. So If I the system waits for 5 or 10 minutes before running the script, the sensor will be again over the400W limit. Itâs a kind of fuzzy logic, but itâs working.
This is my code:
service_template: >
{% if states('sensor.neo_extsud_lux') | float > 400 and state_attr('sun.sun','azimuth') | int> 100 and state_attr('sun.sun','azimuth') | int < 260 %}
input_boolean.turn_on
{% else %}
input_boolean.turn_off
{%- endif -%}
entity_id: input_boolean.blinds_clearance
I also declared an âaverageâ value for the pvpower sensor:
# average pvpower
- platform: statistics
entity_id: sensor.pv_power
name: avg_pvpower
sampling_size: 20
max_age:
minutes: 10
So now youâve got the real context ![:slightly_smiling_face: :slightly_smiling_face:](https://community.home-assistant.io/images/emoji/twitter/slightly_smiling_face.png?v=12)
ok, what I didnât mention is that main triggers are inside and outside temp sensor.