emsesp / EMS-ESP

ESP8266 firmware to read and control EMS and Heatronic compatible equipment such as boilers, thermostats, solar modules, and heat pumps
https://emsesp.github.io/docs
GNU Lesser General Public License v3.0
304 stars 97 forks source link

Req: Plain EMS Messaging via MQTT #11

Closed sysrun closed 5 years ago

sysrun commented 5 years ago

Hi,

your code works quite good on my Buderus (BC10/RC35)

I am trying to implement more functionality (Like Party-Mode etc) into the code. For that, it would be awesome to have a "raw" functionality:

Is it possible to add this functionality?

Cheers, Frederik

proddy commented 5 years ago

Both should be simple to implement but I need more requirements

if you're looking to send commands to the EMS there are probably easier ways to do specific to the functionality you're are looking for.

sysrun commented 5 years ago

Awesome :)

Exact format would be "[src] [dest] [type] [offset] [data]" as HEX - like "0B103F910101" - the ESP (Your code) would then add "[crc] " and push it to the Bus. I think the ESP do no't have to be aware about the data, its just for trying different commands. So IMHO we don't need a re-send logic here. Just fire and forget.

On the other hand, if the "debug mode" is enabled, the ESP should just pipe the incoming BUS data to a special MQTT Topic - no check, no decoding, just the plain data as HEX

My point for that is: Its easier for me to try thing on the bus - instead of Uploading new code every time (whichs sometimes does not work over OTA so i have to down into my cellar...)

Sidenote: I am experimenting with the EMS since several years now and build the HW and a NodeJS decoder myself :) Now i got BBQKEES ready-to-go circuit and i want to use your code instead of a Raspberry ;)

sysrun commented 5 years ago

Idea 2 would be some kind of Telnet <-> Bus bridge-mode

proddy commented 5 years ago

ok, probably using telnet is easy then and not bother with mqtt.

So for sending how about a command from telnet that takes a parameter and sends this as a valid telegram ([data] [crc]) to the ems bus. Fire and forget. If anything comes back it'll be echo'd in the 'verbose' logging mode. What that work?

sysrun commented 5 years ago

Yeah, i think that would work :) CRC is calculated by the ESP?

How would the reply be logged? Is it possible to get a "raw" log-mode? No colors, no text, just data (with a newline at the end)

proddy commented 5 years ago

yes CRC is calculated by the code. Raw log mode is easy to add too - what needs to be shown, all telegrams from all devices on the bus?

sysrun commented 5 years ago

Nice :)

Yeah just the dirty raw data coming in: "11 22 33 44 55 66 .. ..\n" - thats it :)

Maybe it would not be a new log-mode but a dedicated "Bridge" mode which can be activated.

sysrun commented 5 years ago

What i imagine is something like this:

proddy commented 5 years ago

I've added raw mode. I'll work on the send piece later after I've figured out this darn Nefit Easy

sysrun commented 5 years ago

Awesome :) Do you have a dedicated branch for testing?

proddy commented 5 years ago

no, when I've added the send logic from telnet I'll upload the new version. I see you've dabbled in coding, why not contribute yourself and do a pull request?

sysrun commented 5 years ago

Happy to contribute new functionalities later - i tried to implement the above logic myself - well, C is really not my home-turf :(

proddy commented 5 years ago

Raw mode supported. Let me know if it works for you. To use, set the logging to Raw and then use the 'r' command

sysrun commented 5 years ago

Awesome! :) Thank you!

I already tried to implement the RC35 - it's a bit complicated because we need to issue two queries: One for the mode and one for the state (temperatures)

proddy commented 5 years ago

you always need 2 queries, same with RC20 and RC30. I can do the coding for you , but no idea if it'll work.

proddy commented 5 years ago

I'll close this issue as it related to the Raw mode I implemented. Can you open a new issue for RC35 support and then'll see how I can help you remotely.