[SOLVED] EspEasy controller / thermostat mqtt setpoint

Hi all,
I have a esp8266 with a temperature sensor running ESP EASY firmware i want to use as a thermostat
I can read the setpoint that is in the esp. by using following item declaration:

Number Badkamer_setpoint "Badkamer ingest. [%.1f °C]" 	<temperature> 	{mqtt="< [mosquitto:ESP_Easy_Badkamer/Setpoint:state:REGEX((.*?))]"}

the problem begins when i need to set the setpoint with a new value:
i need to publish a message with following payload: “config,task,Badkamer,setlevel,21.5”
where the 21.5 is the value that needs to be set.
the decimal is noted with a point and in my own locale we use a comma so if i just would publish the value from the item i would get “21,5” and not “21.5” is there a way with transformation or rule i could do this and add the text that needs to be in it as well.


With EspEasy I am not sure that his is the right payload.

according to www.letscontrolit.com/wiki/index.php/LevelControl


this works so it should work on mqtt topic

I get it.
Use a javascript transform

Create a setpoint.js file in the transform folder
with the following content:

(function(i) {
    var target = i.replace(',','.');
    return 'config,task,Badkamer,setlevel,' + target;

And you item:

Number Badkamer_setpoint "Badkamer ingest. [%.1f °C]" 	<temperature> 	{ mqtt=">[mosquitto:ESP_Easy_Badkamer/Setpoint/cmd:command:*:JS(setpoint.js)],<[mosquitto:ESP_Easy_Badkamer/Setpoint:state:default]" }
1 Like

thx Vincent
the javascript transform works but it looks like the ESP only reacts on the http command and in the web interface but not in the mqtt payload so it still does not work.Ill need to get the solution from the esp easy developers i guess.

If you did not change the default settings all ESPEasy topics start with a leading slash.

I changed the default settings and it does not work if u set it up without the leading slash… so going back to default. but still does not work with commands like TaskValueSet and setlevel. Still testing/ troubleshooting.

To get it working ill need to set up the outbound part of the item as a http action :frowning:

Changing setpoint on MQTT works… there is only a max of flash writes/day when u go over that it stops working.