the78mole / esphome_components

ESPhome Components from the little digger
Other
24 stars 11 forks source link

[Feature Request] Update the clock #66

Closed mohnen closed 8 months ago

mohnen commented 1 year ago

Would it be possible to set the clock of the Logamatic via this interface? Currently, I use BUDERUS Fernbedienung BFU for this.

jensgraef commented 1 year ago

Hi mohnen and welcome to our little project!

It looks to me that it's possible to send a message to the Logamatic to update the time. dewenni has implented this in his firmware: https://github.com/dewenni/ESP_Buderus_KM271/blob/main/src/km271.cpp#L1530

Currently this software can not do it - but I don't think it's too much work. Do you have a suggestion on how to handle the Home Assistant side? We could start with a simple button that takes the current time and date according to home assistant and write it to the heater.

mohnen commented 1 year ago

Hi,

I guess a button would be nice. An automation which "presses" the button once a day should cover the daylight savings.

Thanks Markus

jensgraef @.***> schrieb am Mo., 8. Mai 2023, 20:21:

Hi mohnen and welcome to our little project!

It looks to me that it's possible to send a message to the Logamatic to update the time. dewenni has implented this in his firmware: https://github.com/dewenni/ESP_Buderus_KM271/blob/main/src/km271.cpp#L1530

Currently this software can not do it - but I don't think it's too much work. Do you have a suggestion on how to handle the Home Assistant side? We could start with a simple button that takes the current time and date according to home assistant and write it to the heater.

— Reply to this email directly, view it on GitHub https://github.com/the78mole/esphome_components/issues/66#issuecomment-1538835129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFRLECTJEPCSW3GF7GSRADXFE2SHANCNFSM6AAAAAAX2BONPE . You are receiving this because you authored the thread.Message ID: @.***>

mohnen commented 1 year ago

I just had an "add-on" idea: If it would be possible to also connect a HA temperature sensor to the "HK1 Raumisttemperatur" (which is currently a sensor, as it is set by the BFU) I could get rid of this BFU completely :) At least as long as I can manually set "HK1 Absenkungsart" to "Raumhalt" even w/o the physical BFU connected.

the78mole commented 1 year ago

You mean, if you could set the actual room temperature in the Buderus by Home Assistant? Hm... I don't know, if the Buderus Unit supports writing to this register on the bus we are using... Maybe @jensgraef can estimate it based on his experience.

jensgraef commented 1 year ago

I don't think we can write to "HK1 Raumisttemperatur". And if it was possible I wouldn't know how to ;-)

What you can actually do to lose the BFUs writing values to

config_heating_circuit_1_room_target_temperature_night: name: "Heizkreis 1 Raumsolltemperatur Nacht"

config_heating_circuit_1_room_target_temperature_day: name: "Heizkreis 1 Raumsolltemperatur Tag"

Without the BFU the Logamatic is estimating the room temperature by some way unknown to be. But if you raise "Heizkreis 1 Raumsolltemperatur Nacht" it will heat more at night and if you raise "Heizkreis 1 Raumsolltemperatur Tag" it will heat more during the day. It think one could use this in combination with a HA room temperature sensor control the room temperature.

If you want to build this, be aware that every time you write a value to the logamatic it will save it to it's internal EEPROM. Like an flash drive the EEPROM will only be able to handle a certain amount of write cycles before it breaks - I believe around one million for the one built into the logamatic. So if you update the value every 10 seconds around the clock, you'll probably wear out the EEPROM within a year. Writing once or twice every hour should be safe a this only leads to roughly 20.000 writes a year.

AlexKusnezov commented 1 year ago

@jensgraef just out of curiosity, the changes that you make not through km271, like directly on the Logamatic by the knob and button. Will they also be written to the eeprom?

jensgraef commented 1 year ago

Yes. Everything not stored in the EEPROM would be gone if you turn off the logamatic or have a power outage. The EEPROM is the only way for the device to "remember" values.

mohnen commented 1 year ago

Yes. Everything not stored in the EEPROM would be gone if you turn off the logamatic or have a power outage. The EEPROM is the only way for the device to "remember" values.

But why is the current value "HK1 Raumisttemperatur" something the device needs to remember? It is updated by the BFU continously (or at least in fixed intervals).

jensgraef commented 1 year ago

Yes. Everything not stored in the EEPROM would be gone if you turn off the logamatic or have a power outage. The EEPROM is the only way for the device to "remember" values.

But why is the current value "HK1 Raumisttemperatur" something the device needs to remember? It is updated by the BFU continously (or at least in fixed intervals).

@mohnen I think we had a misunderstanding here. You are right, "HK1 Raumisttemperatur" is a value that is most certainly read directly from the BFU. But I don't think we can write this value via the KM271_WIFI. What is possible to achieve your goal:

These configuration settings are stored in the EEPROM.

jensgraef commented 1 year ago

Hi @mohnen!

I just open pull request #68 to allow setting the date and time. If you like you can test it using the branch feature/set-buderus-time - or wait until it's merged to master.

It's currently not really polished :) The following link explains how to enable it. https://github.com/the78mole/esphome_components/blob/1f9c4ef13fa7c7bce1227b91ff6b8945ffd1b058/components/km271_wifi/README.md#how-do-i-set-the-time--day-of-week-of-the-heater-via-home-assistant

mohnen commented 1 year ago

Hi,

thats great news. Unfortunately, I currently just don't have time to test it.

On Sun, May 21, 2023 at 7:44 PM jensgraef @.***> wrote:

Hi @mohnen https://github.com/mohnen!

I just open pull request #68 https://github.com/the78mole/esphome_components/pull/68 to allow setting the date and time. If you like you can test it using the branch feature/set-buderus-time - or wait until it's merged to master.

It's currently not really polished :) The following link explains how to enable it.

https://github.com/the78mole/esphome_components/blob/1f9c4ef13fa7c7bce1227b91ff6b8945ffd1b058/components/km271_wifi/README.md#how-do-i-set-the-time--day-of-week-of-the-heater-via-home-assistant

— Reply to this email directly, view it on GitHub https://github.com/the78mole/esphome_components/issues/66#issuecomment-1556237933, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFRLEE6QM5PIA3M5BHOYMLXHJH7XANCNFSM6AAAAAAX2BONPE . You are receiving this because you were mentioned.Message ID: @.***>

margritstein commented 8 months ago

@jensgraef Are you still planning of merging it into master or does @the78mole need to do it?

jensgraef commented 8 months ago

@jensgraef Are you still planning of merging it into master or does @the78mole need to do it?

I'd like to get a thumbs up from @the78mole before merging it. I've pinged him on the pull request.

the78mole commented 8 months ago

Hi Jens, if you can merge it, feel free to do so. I hope it is tested enough :-P

jensgraef commented 8 months ago

It has been merged to main.