Replies: 46 comments
-
I would agree using syslog is the easiest way. With debug on and MQTT off (because there's a lot of messages). Then a script in python, JS or shell (using curl) to invoke the commands in batches every n seconds. What we could do is add a new API command that sets a marker in the syslog so you can see which commands are called when. Would that help? It'll be good to get EMS-ESP closer to the KM200 and complete the missing library. |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to enable/disable syslog by API command?
I am ready to support. |
Beta Was this translation helpful? Give feedback.
-
yes that would work. I'll create a new API endpoint called 'system/syslog_level' which takes a json body where 'value' has the syslog level. So OFF is off and DEBUG is on in this case. Do you need some help with the scripting? |
Beta Was this translation helpful? Give feedback.
-
Thanks, not for the moment since I have all code already. |
Beta Was this translation helpful? Give feedback.
-
@proddy just a question related to syslog messages set as hexadecimal bytes: Is crc send as well as last byte? If yes: How is crc byte calculated? First testings and resulting telegrams from gateway (48) to boiler (08). Value is send as hex in byte 5: dhwCircuits.dhw1.temperatureLevels.high value:50 ---> 48 08 EA 06 32 19 dhwCircuits.dhw1.temperatureLevels.low value:45 ---> 48 08 EA 12 2D 2E |
Beta Was this translation helpful? Give feedback.
-
If the option "Output EMS telegrams as hexadecimal bytes" is enabled then the last byte will be the CRC. I use a lookup table for speed in the EMS-ESP code (see telegram.cpp line 50). |
Beta Was this translation helpful? Give feedback.
-
EMS-ESP uses EA (the telegram type ID) with offset 6 to write the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I recommend to discuss this in a seperate thread later. I still struggle with your name conventions: I will prepare an overview related to RC310 and EMS+ but it might take some time. |
Beta Was this translation helpful? Give feedback.
-
I tried to test within a JS program but it turned out to be unnecessary complex. I would like to test sending telegrams by myelf rather then just watching telegrams send by the km200 gateway. |
Beta Was this translation helpful? Give feedback.
-
this code snippet will calculate the CR, if you can re-write in JS: // Calculate CRC for buffer
uint8_t ems_crc( char * buffer, int len ){
uint8_t i,crc = 0x0;
uint8_t d;
for(i=0;i<len-2;i++){
d = 0;
if ( crc & 0x80 ){
crc ^= 12;
d = 1;
}
crc = (crc << 1)&0xfe;
crc |= d;
crc ^= buffer[i];
}
return crc;
} |
Beta Was this translation helpful? Give feedback.
-
yes this needs looking at with Michael when he's back. Also why the value is been re-written each time. Do you still need an API call to set the SysLog log level? Or add a marker? |
Beta Was this translation helpful? Give feedback.
-
I think midterm it makes sense to be able to set SysLog level by API (marker does not make a lot of sense), but wait until we have discussed the other topics. In the meatime I use node-red with the syslog-node in node-red and I am filtering the messages in node-red (e.g. from gateway to boiler) and then analyzing just the filtered messages. Whenever I change a km200 field value within my ioBroker adapter just one single telegram is send to boiler / thermostat. So it is easy to analyze within node-red for the moment.
Do you know in which broadcasting telegrams the wwseltemp is included? |
Beta Was this translation helpful? Give feedback.
-
wwseltemp is from telegram 0xE9 (offset 10 of the data block). There is also wwsettemp in 0xE9 at offset 0. It's confusing what the difference is. |
Beta Was this translation helpful? Give feedback.
-
Offset 10 of E9 is always 3C (60°C) and never change when I change the templevel_high. Just Offset 0 is changed but I guess that this would be rather actual settemp than temp_level_high. Since I do not find any value representing temp_level low in E9 I believe that E9 does not contain the data for temperature levels. |
Beta Was this translation helpful? Give feedback.
-
@proddy @MichaelDvP In the meantime I installed v3.2.2b1 without node red and reading the syslog within javascript. But now I am confused because syslog content/format changed from previous versions. |
Beta Was this translation helpful? Give feedback.
-
I don't know or use node so can't help you there I'm afraid. It may be easier to capture some syslog on 3.2.1 and then compare it to 3.2.2b1. Without seeing real examples of what is not working its difficult to assist. |
Beta Was this translation helpful? Give feedback.
-
Last changes of @MichaelDvP made syslog working again with node-red. Thanks a lot. 🥇 BTW: Are there already API commands for syslog available? |
Beta Was this translation helpful? Give feedback.
-
yes. |
Beta Was this translation helpful? Give feedback.
-
Thanks but these are console commands. |
Beta Was this translation helpful? Give feedback.
-
@MichaelDvP looks like we need to start updating the wiki. I hate writing doc but i think its needed |
Beta Was this translation helpful? Give feedback.
-
In principal: Yes. |
Beta Was this translation helpful? Give feedback.
-
I meant adding to the table here https://emsesp.github.io/docs/#/APIv3?id=system-endpoints with an explanation of the payload |
Beta Was this translation helpful? Give feedback.
-
I created a setup with syslog-server in a javascript with filter functions and then used my ioBroker adapter to change all writeable fields in km200 and ems-esp and discover the telegrams send on the ems-bus by analyzing the telegrams on syslog afterwards. Let me share the result: Does this help? |
Beta Was this translation helpful? Give feedback.
-
Thanks, for the |
Beta Was this translation helpful? Give feedback.
-
Yes since I can test only fields marked writable - so all km200 fields are marked writeable by rest-api. |
Beta Was this translation helpful? Give feedback.
-
The switchtime-coding is 2 bytes per switchtime, first byte upper 3 bits: day of week, lower 3 bits: mode, second byte time in steps of 15 min. SwitchProgramA, Data 03 14 01 58 FF FF FF FF FF FF FF FF is first: day 0, mode 3, 300 min, second: day 0, mode 1, 1320 min, all other times disabled. (btw. ems RC35 uses 10 min per step) Why are the value/data for modes like |
Beta Was this translation helpful? Give feedback.
-
The holiday modes hm1 .. hm5 are defined within rest-api:
3.hcMode:
AUTO_SAT is defined as same as Saturday .... whatever this is for during holidays
|
Beta Was this translation helpful? Give feedback.
-
@MichaelDvP @proddy |
Beta Was this translation helpful? Give feedback.
-
closing. |
Beta Was this translation helpful? Give feedback.
-
Since I am using ems-esp and km200 in parallel, I ask myself what would be the most efficient / elegant way to debug missing fields in ems-esp while triggering changes on km200.
My idea would be: Within a javascript code writing changes to km200 and analyzing the respective telegrams by "filtering the right ones" out of syslog.
What do you think or what would be the easiest way to identify the right telegram types and content.
Beta Was this translation helpful? Give feedback.
All reactions