Hi,
I customized my AC with an ESP8266 that communicates serial to the AC and via MQTT towards Openhab.
Now, to control the AC the following set of parameters needs to be sent (part of them or all, depends on what you want from the AC).
I’m not sure how i would do that, so that e.g. when using an “on” item to turn it on (which works thanks to @rossko57)…that it would take all other parameters from additional items (like mode, fan speed, setpoint temp) and create this JSON format above…what possibilities do I have, rule-based + mqtt-action binding?
rule "Player State to MQTT"
when
Item Tv received command
then
val timestamp = new DateTimeType()
val value = '{\"attribute\": \"player\", \"value\": \"' + receivedCommand + '\", \"timestamp\": \"' + timestamp + '\"}'
val actions = getActions("mqtt","mqtt:broker:myMQTTBroker") // myMQTTBroker is the name of my broker yours may be different
actions.publishMQTT("tv/player",value)
logInfo("publishMQTT", value )
end