Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min_on_time_per_day_min value seems not working #78

Open
Superdada44 opened this issue Nov 20, 2024 · 9 comments
Open

min_on_time_per_day_min value seems not working #78

Superdada44 opened this issue Nov 20, 2024 · 9 comments
Labels
bug Something isn't working P1 Priority

Comments

@Superdada44
Copy link

Version of the custom_component

2.1.1

Configuration

algorithm:
initial_temp: 1000
min_temp: 0.1
cooling_factor: 0.95
max_iteration_number: 1000
devices:

  • name: "Chargeurs_velos"
    entity_id: "switch.smartplug230v_1_l1"
    power_max: 300
    check_usable_template: "input_boolean.enable_solar_optimizer_velos"
    duration_min: 15
    duration_stop_min: 5
    action_mode: "service_call"
    activation_service: "switch/turn_on"
    deactivation_service: "switch/turn_off"
    battery_soc_threshold: 0
    min_on_time_per_day_min: 0
    max_on_time_per_day_min: 960
    offpeak_time: "22:05"

  • name: "Deshumidificateur"
    entity_id: "switch.smartplug2"
    power_max: 520
    check_usable_template: "input_boolean.enable_solar_optimizer_deshumidificateur"
    duration_min: 15
    duration_stop_min: 5
    action_mode: "service_call"
    activation_service: "switch/turn_on"
    deactivation_service: "switch/turn_off"
    battery_soc_threshold: 0
    min_on_time_per_day_min: 0
    max_on_time_per_day_min: 960
    offpeak_time: "22:05"

  • name: "Chargeurs_accus"
    entity_id: "switch.smartplug3"
    power_max: 50
    check_usable_template: "input_boolean.enable_solar_optimizer_chargeurs_accus"
    duration_min: 15
    duration_stop_min: 5
    action_mode: "service_call"
    activation_service: "switch/turn_on"
    deactivation_service: "switch/turn_off"
    battery_soc_threshold: 0
    min_on_time_per_day_min: 60
    max_on_time_per_day_min: 960
    offpeak_time: "22:05"

  • name: "Boiler_ECS"
    entity_id: "switch.smartrelay1"
    power_max: 2200
    check_usable_template: "input_boolean.enable_solar_optimizer_boiler_ecs"
    duration_min: 20
    duration_stop_min: 5
    action_mode: "service_call"
    activation_service: "switch/turn_on"
    deactivation_service: "switch/turn_off"
    battery_soc_threshold: 0
    max_on_time_per_day_min: 270
    min_on_time_per_day_min: 60
    offpeak_time: "22:05"

Describe the bug

min_on_time_per_day_min value seems not preventing device from starting at the offpeak_time.
Boiler_ECS has run for 242 minutes today, but arriving at offpeak_time 22:05, he switched on again. He stay on until the max_on_time_per_day_min is reached.

Something wrong in my conf ?

Thanks for your help

Debug log

In attached
home-assistant_solar_optimizer_2024-11-20T21-09-09.376Z.log

@jmcollin78
Copy link
Owner

Hello @Superdada44 ,

your config seems good.
What I see from the logs:

2024-11-20 22:06:05.013 we should force Boiler_ECS name
2024-11-20 22:06:05.013 Allumage de Boiler_ECS

Donc en effet, il y a eu un démarrage offpeak.

A 22:06 je vois que le on_time était de 14520 sec soit 4 h piles:

2024-11-20 22:06:05.316 Boiler_ECS - Set on_time=14520

So it seems to have a bug.
I see you have restarted HA at 18h23, maybe it has reset something.
Can you please, try to not restart today to see if the bug persist.

An please, next time send the attributes of the Boiler_ECS device (Development Tools/States) after 22:05 and before the reset time (05:00 ?). It will give me all the values used for calculation.

@jmcollin78 jmcollin78 added bug Something isn't working question Further information is requested P1 Priority labels Nov 21, 2024
@Superdada44
Copy link
Author

Thanks for your analysis ! :-)
we had snow today, so no device reached the min... I'll hope to be able to add more information tomorow !

@jmcollin78
Copy link
Owner

Hello,

yes same for me. Almost 10 cm.

so no device reached the min

yes so they will all start off-peak. It has started at home (22:00)

when you configure like that:

min_on_time_per_day_min: 0
max_on_time_per_day_min: 960
offpeak_time: "22:05"

what do you want to do exactly ? You want to always start offpeak or you want to never start offpeak ?

@Superdada44
Copy link
Author

Hello,

Yes, he start correctly yesterday at the offpeak hour. And when during the day, the max_on_time_per_day_min is reached he also stop correctly.

Yes, with the value "min_on_time_per_day_min: 0" I expect that he never start during offpeak hours. So it's like "solar only".
I use that for the air dryer, it's not mandatory that he run every day.

Have a good day !

@jmcollin78
Copy link
Owner

Yes, with the value "min_on_time_per_day_min: 0" I expect that he never start during offpeak hours. So it's like "solar only".
I use that for the air dryer, it's not mandatory that he run every day.

Ok, it should then starts if there is 0 minutes (on_time <= min_on_time). You rather should remove the min_on_time_per_day_min and offpeak_time for this device.

@jmcollin78
Copy link
Owner

I keep the issue open for a week. Let me know if you have reproduce the case.

@jmcollin78 jmcollin78 removed the bug Something isn't working label Nov 22, 2024
@Superdada44
Copy link
Author

Superdada44 commented Nov 22, 2024

Thanks for the min_on_time_per_day_min=0, I will remove it.

The boiler just reached the min value today ! So here is the value of sensor.on_time_today_solar_optimizer_boiler_ecs and in attached the debug log.

state_class: measurement
last_datetime_on: null
max_on_time_per_day_min: 270
max_on_time_per_day_sec: 16200
on_time_hms: 1:08:00
max_on_time_hms: 4:30:00
raz_time: 05:00:00
should_be_forced_offpeak: false
offpeak_time: 22:05:00
unit_of_measurement: s
device_class: duration
icon: mdi:timer-play
friendly_name: Solar Optimizer-Boiler_ECS On time today

home-assistant_solar_optimizer_2024-11-22T21-09-09.002Z.log

@jmcollin78
Copy link
Owner

The boiler just reached the min value today ! So here is the value of sensor.on_time_today_solar_optimizer_boiler_ecs and in attached the debug log.

Does it start offpeak ?

@Superdada44
Copy link
Author

Yes, the problem is still present, Boiler_ECS switched on at 22:06:08, and off at 1:30:08.

@jmcollin78 jmcollin78 added bug Something isn't working and removed question Further information is requested labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Priority
Projects
None yet
Development

No branches or pull requests

2 participants