Scheduler card/custom component

Maybe related: https://github.com/nielsfaber/scheduler-card#my-climate-entity-does-not-work-when-i-create-a-schedule-to-change-the-temperature

Thanks I saw that part but really thought that the generic_thermostat wasnā€™t part of those ā€œdevicesā€ that could not be working due to it being a base component of HA :confused:
I implemented that piece of code, and it does exactly what the component is already doing, changing the temperature but not switching the hvac to ā€œheatā€.
I could still try to create an automation that would switch the heater on if it detects a change in set_tempā€¦

Actually @KTibow is right and thereā€™s a bug in the generic thermostat.
Please follow his link and try again.
I will see if I can make a better solution (because youā€™re not the first with this issue).

1 Like

Ok I just modified the code and will report back in 2 minutes if the heating switched on !
Thanks to both of you !

EDIT : it didnā€™t :frowning: But the set_temperature changed.
I donā€™t see what would change hvac_mode to ā€œheatā€ in the piece of code KTibow references ?

Ok there is definitely a bug in the implementation of the climate.set_temperature in the generic_thermostat.
You cannot change the property of hvac_mode through this service :frowning:
Iā€™ll try to use a script with the scheduler to set temp and hvac_mode to ā€œheatā€ through the climate.set_hvac_mode service which is working

Thank you :slight_smile:

Hello.
Is there someone who can share his custom code of Scheduler Card ?
Itā€™s to see how to add the customize section.

Read the docs

I read it but it will be really helpfull for me. I need some clues to understand what to write and how. Iā€™m not a YAML coder.

I just want to say: Are you sure you need to customize it? The GUI should be just fine, and you should really learn some basic coding and YAML understanding if you want to customize HA, or anything in it without a GUI. Anyway, not trying to be mean to you, just saying. Also try reading the last 25 replies.

Sorry, i misunderstood.
Yes i want to customize because i want to show the friendlyname on my card.
i know that i need to learn YAML coding and i first understood the big importance of indent for example.
I succeeded customizing HA with different sample provided and with succession of testing - correcting - testing - correcting ā€¦

This might help you:


(I think they forgot to change the description, Linux doesnā€™t use YAML)

Ok, Iā€™ve made a copy of the generic_thermostat as a custom_components and added the necessary bits in its code to handle setting the hvac_mode with the set_temperature service and guess what, your component works perfectly :smiley:
Iā€™ll see if I can open a PR on HA Github but itā€™s been a while since Iā€™ve used itā€¦

Thank you again for your component, itā€™s beautiful.

3 Likes

One day on HA and you already joined the dark side :yum:
I like your guts!
Would be great if you can take initiative to have it fixed, because a lot of people blame the scheduler for implementing things correctly. :+1:

Glad you like it!

Donā€™t be scared of YAML :slight_smile:
Check my post here and the docs.
Its really a matter of copy-pasting.
Just try and see the result.

I have a different genetic_thermostat setup:

  - platform: generic_thermostat
    name: Salon
    heater: switch.podlogowka_salon
    target_sensor: sensor.temperatura_salon
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 30

I didnā€™t test the scheduler integration yet, Iā€™m in process of setting up a test environment right now.
@snoopy1492 why do you need initial_hvac_mode? In my case, the generic thermostat works perfectly. Currently, Iā€™m using automation, but I want to replace all of them with scheduler integration and card.
btw do you have your modification available online?
Iā€™d like to check them in my setup

Iā€™m using initial_hvac_mode set to ā€˜offā€™ to be sure that at startup no heating is done until an automation or schedule asks for it.
Iā€™ve had different experiences with other automation software and I prefer to be cautious as I donā€™t want my house to be heated for days without no reason just because the mains went out and a bug occurred and none of my automations started
That way Iā€™m sure that the default is ā€œno heatā€.

As for the modification I made, the schedule component uses the climate.set_temperature service to set the temperature AND switch between the different hvac mode (mainly on or off for the generic_thermostat).
This is one of the service available in the climate integration per HA documentation (Climate - Home Assistant).
Unfortunately the generic_thermostat platform doesnā€™t implement this functionnality. With the climate.set_temperature, you can only set the temperature.
The scheduler component then cannot switch the heat on or off on a generic_thermostat. It can only change the target temperature.
So if your thermostat is off (and I mean switched off, not just not heating due to the temp not requiring it), the scheduler will just adjust the temp but the thermostat will stay off and wonā€™t heat.

What Iā€™ve done is change the function in the generic_thermostat code so you can pass two arguments to the set_temperature function, the target temperature and the hvac mode as per the documentation.
And now everything works.

Iā€™m in the process of installing everything to be able to submit my PR to HA Github. Iā€™ll also make my custom_component available in case someone wants it.

Iā€™m sure there is a discussion around the generic_thermostat available here, we should go there if we want to continue :slight_smile:

3 Likes

@snoopy1492 your case is a good example. Thank you for your explanation :+1:
Sorry for a non-scheduler related question.
Letā€™s focus in this thread on the scheduler only.

Hello
Right now itā€™s 5.15 PM and the next action is scheduled at 6.30 PM and the scheduler card shows ā€˜and 15 minutesā€™

Overview-Home-Assistant

Overview-Home-Assistant (1)

Do you know what to change ?
Thanks

I will make a fix for that.
Itā€™s actually due to broken translations. But that doesnā€™t make it less bad :slight_smile:

Actually: which version of the card are you running? and which language?
Because for me it shows fine for English.

version 1.9.3
language english UK

and settings

type: 'custom:scheduler-card'
title: Chauffage
standard_configuration: true
include:
  - climate
time_step: 1
display_options:
  primary_info: '{entity}: {action}'
  secondary_info:
    - relative-time
  icon: entity

thanks for your help

@Merangle I just created a new release v1.9.4 with a ā€˜creativeā€™ workaround for this.
I hope it improves things for you.

There are still some glitches sometimes with loading translations from the frontend.
Ever since they introduced lazy-loading, depedencies are very unreliable.
Unfortunately, missing translation will just result in disappearing wordsā€¦
There is no fallback to english or whatsoever.

@Canaletto Since you addressed the same problem, maybe updating would help you as well.
However, i see that still the french translation is not fixed. The relative time might show up in english instead of french (if the time is <6 hrs from now).

1 Like