klausahrenberg / WThermostatBeca

Replaces original Tuya firmware on Beca thermostat with ESP8266 wifi module
395 stars 96 forks source link

Can't change targetTemperature via mqtt #280

Closed dwarning closed 1 year ago

dwarning commented 1 year ago

I try to set the parameter of my ME81AH over mqtt on my pi, where the broker is running: pi@raspberrypi:~ $ mosquitto_pub -d -t Thermostat_Bad/thermostat/properties/TargetTemperature -m "22.00" Client mosqpub|16115-raspberry sending CONNECT Client mosqpub|16115-raspberry received CONNACK (0) Client mosqpub|16115-raspberry sending PUBLISH (d0, q0, r0, m1, 'Thermostat_Bad/thermostat/properties/TargetTemperature', ... (5 bytes)) Client mosqpub|16115-raspberry sending DISCONNECT I made also variations for the topic path like 'Thermostat_Bad/cmnd/things/thermostat/properties' or similar. I used latest version from this website and also the alternatives from @AlbertWeterings. In the end I have no (!) success to change the parameter.

This is my constellation: pi@raspberrypi:~ $ mosquitto_sub -v -t Thermostat_Bad/'#' Thermostat_Bad/clock/properties {"ntpServer":"pool.ntp.org","timeZoneServer":"http://worldtimeapi.org/api/ip","epochTime":1668209912,"epochTimeFormatted":"2022-11-11 23:38:32","validTime":true,"timezone":"Europe/Berlin"} Thermostat_Bad/thermostat/properties {"idx":"Thermostat_Bad","ip":"192.168.178.22","alive":false} Thermostat_Bad/thermostat/properties/deviceOn true Thermostat_Bad/thermostat/properties/schedulesMode off Thermostat_Bad/thermostat/properties/locked false Thermostat_Bad/thermostat/properties/systemMode heat Thermostat_Bad/thermostat/properties/sensorSelection internal Thermostat_Bad/thermostat/properties/Temperature 21.50 Thermostat_Bad/thermostat/properties/TargetTemperature 23.00 Sorry for the bad format of the code insertions. Don't know how to make it better.

PhilipTS commented 1 year ago

You are publishing your value in the properties. This is wrong, you subscribe to the properties to receive them but you use a different subject to publish your changes. Usually we replace the properties with set but I don;t remember exact details. Look around and just keep in mind that we subscribe to the properties to receive updates. We publish on a different subject to make changes.

dwarning commented 1 year ago

Ok, the world is so simple. Thank's from a mqtt beginner. Replace the subject properties with set works very well. I struggled because I couldn't see a set entry in JSON tree if I call the IP of the device. Also MQTT explorer shows only properties entries.

dwarning commented 1 year ago

With the @AlbertWeterings fork version 1.0.8_Beta I was able to set TargetTemperature on the ME81AH.

Now with the actual version 1.25_beta from @klausahrenberg the same set command to targetTemperature didn't show effect, whether to display nor to MQTT Explorer.

Question is: How and by which tool can I see the list of "set"able variables? Is there web page for the IP of this device? If I put in the IP alone I see a JSON tree only with properties.

AlbertWeterings commented 1 year ago

@dwarning

Question is: How and by which tool can I see the list of "set"able variables? Is there web page for the IP of this device? If I put in the IP alone I see a JSON tree only with properties.

When I started working on my ME102H device I have used a NodeMCU to capture the communication in between the WiFi/Tuya module with the original firmware and App and the thermostats MCU. This was working reasonable well. At some point I started to work with @PhilipTS and switched to using the program Realterm. Be aware you can't connect a serial interface to the thermostat when you power it from mains!! this will blow up your equipment!! and is dangerous

Then while monitoring the data changing all settings in the App it was easy to capture all possible settable variables. Also the Tuya Cloud Developer Platform revealed some of the functions. This helped @PhilipTS and me to find all settable variables for the ME102H thermostat.

So if you want to know all the supported commands this is I think the way to go. I did not see anyone who has documented them all yet.

robertorobles commented 1 year ago

@dwarning the topic to send the change of a property is "set" not "properties" (properties is to query it) can you try this? mosquitto_pub -d -t Thermostat_Bad/thermostat/set/TargetTemperature -m "22.00"

dwarning commented 1 year ago

It is OK with v. 1.0.10 - I can set it up and down.

Am 19.11.22 um 20:21 schrieb Roberto Robles Fernández:

|mosquitto_pub -d -t Thermostat_Bad/thermostat/set/TargetTemperature -m "22.00"|