emsesp/EMS-ESP

Boiler -> heatingActivated how to?

kempa007 opened this issue · 12 comments

Hi,

I'm running ems-esp E32 board, and slowly everything is working, but I can't figure out how to set boiler heatingActivated variable wih my OpenHab MQTT binding.
This is the log:

Received boiler => {cmd:"heatingactivated", data: 0, id="123"} (length 43) 002+09:18:48.481 E 6: [mqtt] MQTT error: payload cmd, error InvalidInput

and this is my things file:
Type switch : boiler_heating_cmd "Wlaczenie/wylacznie ogrzewania" [commandTopic="ems-esp/boiler", formatBeforePublish="{cmd:\"heatingactivated\", data: %d, id=\"123\"}"]
First of all I would like to make sure that I'm using the right id.

This is my api/boiler ( I assume, that id is the right id for my boiler?):

   
id 123
heatingactive 0
tapwateractive 0
selflowtemp 27
selburnpow 100
heatingpumpmod 0
outdoortemp 16
curflowtemp 56.7
switchtemp 22.6
burngas 0
flamecurr 0
heatingpump 0
fanwork 0
ignwork 0
heatingactivated 1

The documentation I just realized for MQTT is very outdated (I'll get to updating that at some point) but the basics are still valid at https://emsesp.github.io/docs/#/MQTT?id=sending-commands

from your specific use case, data is either 1 or 0 (or on/off or true/false) and you don't need the id as it's really only used for the Thermostat when identifying multiple heating circuits.

you may also need to put quotes around the cmd and data but I'm not sure - depends on the client

which EMS-ESP version are you using?

Yes, you helped me few days ago with setting up thermostat temperatures. So I upgradeed to the beta you did recommend. So I can just delete id field or leave it empty?

The quotes I just copied from thermostat commands which are working so should be okay.

After leaving id empty I've such log:

Received boiler => OFF (length 3)
002+10:24:30.077 D 15: [mqtt] Publishing topic ems-esp/boiler_data (#22132, retain=0, retry=1, size=533, pid=1)
002+10:24:30.179 D 16: [mqtt] Publishing topic ems-esp/boiler_data_ww (#22133, retain=0, retry=1, size=423, pid=1)
002+10:24:30.281 D 17: [mqtt] Publishing topic ems-esp/thermostat_data (#22134, retain=0, retry=1, size=926, pid=1)
002+10:24:30.383 D 18: [mqtt] Publishing topic ems-esp/mixer_data (#22135, retain=0, retry=1, size=148, pid=1)
002+10:24:40.070 D 19: [mqtt] Publishing topic ems-esp/boiler_data (#22136, retain=0, retry=1, size=533, pid=1)
002+10:24:40.171 D 20: [mqtt] Publishing topic ems-esp/boiler_data_ww (#22137, retain=0, retry=1, size=423, pid=1)
002+10:24:40.273 D 21: [mqtt] Publishing topic ems-esp/thermostat_data (#22138, retain=0, retry=1, size=926, pid=1)
002+10:24:40.375 D 22: [mqtt] Publishing topic ems-esp/mixer_data (#22139, retain=0, retry=1, size=148, pid=1)
002+10:24:47.654 D 23: [emsesp] No telegram type handler found for ID 0x255 (src 0x21)
002+10:24:50.044 D 24: [mqtt] Publishing topic ems-esp/boiler_data (#22140, retain=0, retry=1, size=533, pid=1)
002+10:24:50.145 D 25: [mqtt] Publishing topic ems-esp/boiler_data_ww (#22141, retain=0, retry=1, size=423, pid=1)
002+10:24:50.247 D 26: [mqtt] Publishing topic ems-esp/thermostat_data (#22142, retain=0, retry=1, size=926, pid=1)
002+10:24:50.349 D 27: [mqtt] Publishing topic ems-esp/mixer_data (#22143, retain=0, retry=1, size=148, pid=1)
002+10:24:53.993 I 28: [command] Calling boiler command ''

Can you tell me what is the right command for setting heatingActivated parameter?

I just tested topic="ems-esp/boiler" payload="{\"cmd\":\"heatingactivated\",\"data\":1}" and it works?

Thanks, now it works too:

Type switch : boiler_heating_cmd "Wlaczenie/wylacznie ogrzewania" [commandTopic="ems-esp/boiler", formatBeforePublish="{cmd:"heatingactivated", data: %s}", on="1", off="0" ] (this is Thing file form OpenHab 3)

Leaving it if someone would have the same problem. Id field was making a problem- I thing so.

the id is ignored so it doesn't matter what value you use with that boiler command.

Your error was a typo id=\"123\" instead of id:123 (the = should be a : )

Yes, i saw it too and corrected. Will check tomorrow again for sure.

So I checked command with id:"" and it is not working. It's very sensitive.

Now I try to find way to do same way with warm water activated value and there are another issues.

I did exactly the same why as with heating, but I got the log:
Executing the JSONPATH-transformation failed: Invalid path '$.wwactivated' in '{"id":123,"heatingactive":1,"tapwateractive":0,"selflowtemp":32,"selburnpow":100,"heatingpumpmod":10,"outdoortemp":13.3,"curflowtemp":35,"switchtemp":25.8,"burngas":1,"flamecurr":15.5,"heatingpump":1,"fanwork":1,"ignwork":0,"heatingactivated":1,"heatingtemp":55,"pumpmodmax":100,"pumpmodmin":10,"pumpdelay":3,"burnminperiod":10,"burnminpower":0,"burnmaxpower":100,"boilhyston":-6,"boilhystoff":6,"curburnpow":25,"burnstarts":13117,"burnworkmin":278663,"heatworkmin":238351,"ubauptime":1055447,"servicecode":"-H","servicecodenumber":200}'

In the above JSON statement I don't even see wwActivated field. Is it okay or something is missing?

I was using boiler_data instead boiler_data_ww, but still cant read warm water activated state:

Type switch : boiler_ww_state "Stan wlaczenia CWU" [stateTopic="ems-esp/boiler_data_ww", transformationPattern="JSONPATH:$.wwactivated", on="1", off="0" ]

it does work with the id - I added it to the test suite and the id is just ignored.

To debug, start using the WebUI to make sure the data is there and writable. Also use the console for debugging. And also use the API to get some values, like http://ems-esp.local/api/boiler/commands will list the available commands (it will show wwactivated).

I think the problems are in your OpenHAB implementation. Best if you consult BBQKees who wrote https://bbqkees-electronics.nl/wiki/gateway/openhab-configuration.html

Yeah, sorry, another typo. It works, I had just use boiler_data_ww topic.

Before you close the topic, I would like to ask you how can I test commands to be sure that they are okay.

go to console, type show commands. To call one do first su then use call, e.g. call boiler activated. You can hit for auto-complete. All this is documented by the way