Egyras / HeishaMon

Panasonic Aquarea air-water H, J, K and L series protocol decrypt
231 stars 118 forks source link

Command point are not available in MQTT #424

Open Skol6 opened 10 months ago

Skol6 commented 10 months ago

Hi,

which setting do I have to add on HeishaMon to get the command points in MQTT?

image

used firmware ist 3.1 Heatpump model WH-MDC07J3E5

Regards

geduxas commented 10 months ago

You just need to create command topic with according command and that should be without retaining flag. Heishamon will not create command topic, it just listen for it.

More details: https://github.com/Egyras/HeishaMon/blob/master/MQTT-Topics.md#command-topics

Skol6 commented 10 months ago

Thanks for the information. I thought Heishamon creates the values automatically including information in MQTT. Would be much easier and helpful :)

geduxas commented 10 months ago

Thanks for the information. I thought Heishamon creates the values automatically including information in MQTT. Would be much easier and helpful :)

No, that's why it should be without retaining flag. Command should apperes once.. becouse eatch time it will be executed.

Please close issue if it's resolved

Skol6 commented 10 months ago

OK now I have tried to set the MQTT value: setState("mqtt.0.panasonic_heat_pump.commands.SetPump", 1, true); BUT: feedback was that this data point does not exist? State "mqtt.0.panasonic_heat_pump.commands.SetPump" not found

Also I do need the retain flag, to set the energy meter correctly in iobroker.

ClassicGOD commented 10 months ago

I think you misunderstand how MQTT protocol works. "Retained" flag means that the message will be repeated to every client connecting to the MQTT broker and subscribing to the given topic. Retained messages are useful for keeping "last known state" but not good for an "instant" uses like commands for HeishaMon.

If you send a retained message to a command topic the command will be executed every time HeishaMon reconnects to your MQTT broker for any reason (disconnect, reboot, anything). You do not want that (usually) so don't do that.

Regarding your error - I'm not familiar with ioBroker but with quick google I assume you are trying to use the pubsubclient library for Arduino so you should probably use client.publish (assuming 'client' is your pubsubclient obj)

mlapp commented 10 months ago

OK now I have tried to set the MQTT value: setState("mqtt.0.panasonic_heat_pump.commands.SetPump", 1, true); BUT: feedback was that this data point does not exist? State "mqtt.0.panasonic_heat_pump.commands.SetPump" not found

Try sendTo('mqtt.0', 'sendMessage2Client', { 'topic': 'panasonic_heat_pump/commands/SetPump', 'message': ('1') });