-
-
Notifications
You must be signed in to change notification settings - Fork 115
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
How to add new values into code? #508
Comments
I would like to start with a first test field for the boiler: wwsupplyDelta - delta temp for ww load from boiler to dhw : Questions: Please correct
|
I am a bit confused looking in more detail to the code. In lines 619-627 in boiler.cpp wwComfort is defined with offset 9. On my RC310 wwComfort is at offset 0x0D with valid values {"0":"high","216":"eco"}. |
Steps to do:
Min/max values are only for commands, then you have to add a set-callback and min/max to the register_device_value and declare the set-callback in boiler.h and code it in boiler.cpp. Line 619ff is telegram 0x33, your boiler uses 0xEA, look at line 770 ff. |
too much code for my old eyes :) Thanks for the clarification and I will start testing ... |
@MichaelDvP the first steps work. The value is shown correctly with the dashboard and on web-api. Super ! May I get a bit help on the command to change the value? |
Take a look at other writable values from the 0xEA telegram.
Instead of 0xEA you can also use BTW: the name |
Value changes work now. Thanks, I was missing the MAKE_CF_CB(set_wwSupplyDelta) addition. 👍 I just ask myself how (and where) to add min/max values?
Yes I just took the name I had from testing. I will check names before continuing. |
this is implemented as
to add the limits:
|
So I should cancel my changes I made until now? |
Adapt them to use same names as other boilers. Yes, sometimes we have to revoke changes if we find a better way. |
@MichaelDvP I see that the enum texts are in locale_EN.h but I do not really understand the steps needed to introduce a new enum list and allocate the enum entries to hex-values for read and write. Could you please advice how to do this? |
For a first try I would like to introduce boiler.wwcomfort - type 0xEA offset 0x0D with values {"0":"high","216":"eco"} |
Enums are normaly numbered 0, 1, 2.., having the DeviceValueType::ENUM and a pointer to a list of entries in the option field of register_device_value(). The list is created in locale_EN.h with MAKE_PSTR_LIST() makro. boiler.wwcomfort is a bit special, because it's not really enum, but contains some fixed signed values for reducing the ww temperature. "eco" is -40°C (0xD8) and "intelligent" -20°C (0xEC). I'm not sure if other values are accepted in this field, my boiler does not have it (fixed to 0x00 (hot), not writable). You can copy the logic from telegram 0x33 to 0xEA offset 13 and modfiy the set_ww_mode() to check EA telegram and write to it. |
The wwcomfort logic on my RC310 is different. If comfort is set to high, then the defined hysteris is used and the ww storage is heated whenever temp is below defined hysteresis - so with 6°C hysteresis approx. 5-6 times a day. With the use of eco the hysteresis is approx. 2-2.5 times as large and 2 heating cycles per day are enough. But in between the ww temp will be lower then with comfort=high. |
The existing wwcomfort has 3 enum entries: Hot, Eco, Intelligent. What would you recommend? Use the existing one or make a new one wwcomfort1 ? |
Using the existing is difficult in boiler-class. Thermostats, and modules have model flag and we can use different enums for different models. But most boilers are not flaged. |
Understood .... on the other side it wood be good to see the enum texts as close as there are shown in the dialog of the thermostat. Would you mind me creating wwcomfort1 as enum? The wwcomfort1 will then be used by type 0xEA. |
If this fit's better to the boiller control, do it. |
@MichaelDvP Thanks for your support so far. I now made PR's for my boiler entities.
So my questions are:
Please advise. |
The values mostly are taken from Norberts1, or users reported it. I don't have a RC3xx compatible thermostat and can not reproduce. What are the settings called on the thermostat display? Implementing values to thermostat is a bit more complicated than boiler. In thermostat.h there is a sub-class heatingcircuit for the hc dependend values and others are in themostat class. At the end of thermostat.cpp the register value is one for main values |
@MichaelDvP My findings / questions:
|
@MichaelDvP @proddy Thanks for explaining the existing variables. You might recognize that I still have problems in understanding & finding the right variables. I do not find them in the online documentation or maybe I am not looking at the right place. Is there any overview of variables and there content available? For the RC310 I will add the mentioned variables since they are not available yet.. |
We've always wanted to explain the variables, and made a start a while ago at https://emsesp.github.io/docs/#/Boiler?id=ems-telegrams-offsets-for-the-device-type-boiler but it's hard and time-consuming to keep it up to date. It may be easier to extract the names directly from the source code using a script. ideas welcome!? |
A good start would be a long-text explanation within locale_EN.h maybe with a reference to the manual (page no). But I understand that the reference might be a bit difficult for all the different thermostat devices. |
Let me ask your opinion about names to be used. As @MichaelDvP indicated RC35 uses variable names: Since I haven't found any English manual for the RC310 i changed the language setting on my RC310 from German to Englisch. Since enums for RC310 are different, shall I use "reducemode1" or better "setbackmode" for the RC310 to be consistent with the display? What about reducetemp / noreducetemp? The "nofrostmode" is called frost protection - so frostprotection would better fit. What is your point of view? |
I really don't know. I only have an RC20. Any change to the entity names will be a breaking change so be cognizant of that. What would be better is to extend the fantastic Customization service so each entity can be renamed as we do with the Dallas & Analog Sensors. |
Since the entities reducemode , reducetemp, noreducetemp, are not available yet for the RC310 this would not be a breaking |
The naming is always difficult. If a function is requested by a user, we first check if we have this already in for other thermostats and try to use the same (save ram, especially for 8266 this was very important). If it's new, we pick the name the user requests. It's very confusing to have different names the same function in thermostat-models, it's more confusing to have a name with different meaning for thermostat models. Edit: Another reference is Norberts list, If a value is listed there it's best to choose the same name for later checks. |
I do understand both remarks, but I am still a bit lost what to do: Telegram type 0x01B9 offset 05 on Norberts list ist named Eco Mode. I understand @MichaelDvP that I should use the existing fields and make a new enum entry reducemode1: OK? |
Yes, we already have different names for same function, like nighttemp, ecotemp, T1. But i don't like the same name for different functions: You can rename |
Hi guys, I have already added quite some new values for the RC310 (PR pending). Up to yet I was only touching existing telegram types. Now I have the first new one which is not defined yet. I will try to introduce the new telegram with |
In
In the documentation you'll find upper left a |
Thanks Michael. I am a bit irritated in the moment. The typeids defined yet for the RC300/RC310 are consecutive hex-numbers. No I want to introduce a new field And telegram length and content differ as well: Any advice how to handle this? |
It seems a bit strange that RC300 telegrams are not numbered in row, all others are. Have you checked in terminal with |
Yes I checked. Telegrams are as above mentioned with set flag set. A read command in terminal gives the same reply.
I will use the existing name - thanks for info.
Yes I will do. |
I do not really understand what I have to do there? After line 204 because thermostat id = 0x10 for RC310? |
RC310 is a master-thermostat, there is no adaptation needed. RC200 is compatible, but a single hc thermostat (0x18 for hc 1, 0x19 for hc2, etc, Combining multiple RC200 is matched there to a "master" at 0x18). The 0x10 section is only for junkers, where 0x10 controlls hc1 and hc2 and for hc3 there is an extra thermostat. |
I do have some difficulties reading the new variables / telegrams. Is there any way to create console or system log messages for debugging ? |
Sure, insert wherever you want a |
Seems to work now. Thanks so far. |
Just a question: For RC300/310 the typeids have 8 entries in thermostat.cpp. |
Ok understood. I made the PR for wwprio (RC310) with only 4 entries since the typeids numbers are not in a row. |
With only 4 entries you have to take care not access or to loop through higher indices. Some loops use monitor_typeids as loopcount. I'll comment in the PR. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I would like to add new values / entities into the code. From Discord I got from @MichaelDvP the following introduction:
There is a guide "contributing.md" how to make the PR, but for the code structure you have to read the code.
It's mostly selfexplaining.
Start with reading a simple device like switch.cpp to see the registertelegram() with it's callback process(telegramname).
In the callback the value is read by has_update(..) and publishing the value is handled by the register _device_value().
That's neary all to do.
In thermostat for hc dependend telegrams you have to add a check in heatingcircuit(telegram).
The text was updated successfully, but these errors were encountered: