Questions about using the EMS-ESP API #1643
-
Hi, I am using EMS-ESP together with Homey Pro. I set up MQTT to read out the data, MQTT didn't work for setting the data (I don't know why, but I've already given up on it, if there's someone who has dealt with it, they can write to me). Now I use API + HomeyScripts (using fetch command) to set and write data. But I have a question about boolean values. Thus, the response from the request http://ems-esp/api/thermostat/wwcharge shows "on" or "off" as a value:
It's just formatting for display only, or for POST request as well? For example in request:
What value should I set "on"/"off" or true/false??? It is interesting that if I use the API to write the value "on" in WWCHARGE, it will start heating the water, but I cannot cancel it on the Junkers FW200 thermostat, or set it back to the value "off" by sending an "off" request. Still, if I look at the dashboard or read the value again using the API, the wwcharge value is still equal to the "on" value. This value is automatically switched off after one hour. What should be the response to a POST request? I have this: Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
MQTT uses wildcard subscriptions, make sure your broker accept this. You have write to topic
You can use always on/Off, true/false, 1/0 or the translated on/off in the selected language.
this is a function of the boiler, the command triggers a charge, the boiler charges until the set temperature is reached. You can lower the target temperature to stop charging.
on success only http 200 (ok), no body. On error http 400 (bad request) or 401 (unauthorized) and the error message in body. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer, I used MQTT as you wrote. But I'll probably have to find out if Homey Broker accepts wildcard subscriptions. |
Beta Was this translation helpful? Give feedback.
MQTT uses wildcard subscriptions, make sure your broker accept this. You have write to topic
device
ordevice/entity
, notdevice_data
as published. Wrting to topicdevice
has to be json{"cmd":"<cmd>", "data":<data>, "id":<n>}
, writing todevice/entity
can be a single value, "data" and "value" are equivalent, also "id" and "hc". Skipping hc defaults to first hc.e.g.
thermostat {"cmd":"seltemp", "data":20, "id":1}
,thermostat/seltemp {"data":20}
,thermostat/hc1/seltemp {"value":20}
,thermostat/hc1/seltemp 20
are equivalentYou can use always on/Off, true/false, 1/0 or the trans…