I am totally noob with zigbee and tuya. And i need advice for smart thermostatic radiator valves

When i contact the supplier of this siterwell trv’s seller said 3 version of them.
One of tuya Zigbee.
One of tuya Bluetooth
One of ZigBee 3.0
I am confused. If i will buy zigbee 3.0 version can i add support for z2m without gateway? Or i need to gateway for sniffing communication. Or i will wait your work. And will buy tuya zigbee version like you.
Seller says siterwell member of zigbee alliance and uses global zigbee standarts.

Ha! They didn’t tell me they had a Tuya Zigbee and a Zigbee 3.0 version. I have no idea which zigbee-based device I bought.

Update 04/04/2020: I got the Zigbee 3.0 version @BTopbas (I read it from the data sent by the TRVs during the pairing process).

The zigbee gateway arrived. But I didn’t notice I need to have run an special firmware on my CC2531 usb stick to be able to sniff zigbee traffic. I don’t have the debugger hardware to do it. I will follow the instructions to do it using my raspberry pi instead but it will require at least a couple of hours of work. I will schedule that in one of these days of quarantine.

But, let me tell you about the Tuya gateway that I received. It was smaller than I expected and the final quality look cheap. But, well, it’s fucking cheap.

The instructions that came with the device said that I need to configure it with an app called Smart Life, published by Tuya. They have another app named Tuya Smart too, but the instructions within the box said Smart Life so, that’s what I installed. Seen the screenshots of Tuya Smart, it looks almost the same.

The most dificult part of pairing the gateway with the newly create Smart Life account was to select the correct device from their catalog. Fuck, they have more than one device named “Gateway” with the same icon. That’s when I started to realize the software might fall below my expectations. Sadly, I was not wrong.
The Smart Life UI responds quite slow, but the icing of the cake falls on the Siterwell UI for this app. It’s just ugly and not very intuitive. To give you an idea, the ugliest Climate component of Home Assistant looks better than this. It works though. With slow feedback, but it works.

Now, the ugliest part: The integration of Tuya with Home Assistant.

I was only interested in the integration of “climate” devices coming from Tuya. According to Home Assistant’s website this type of device is supported. And technically it does, but how is implemented is a joke.

This is the data that came for one Siterwell TRV from Tuya:

hvac_modes: off
min_temp: 50
max_temp: 300
target_temp_step: 1
current_temperature: 224
temperature: 235
friendly_name: Dormitorio
supported_features: 1

As you can see, no list of available HVAC modes, current HVAC mode, nor battery status. And yes, the decimal separator is not added, ending with a whopping 224 Celcius for room temperature.
Changing the target temperature from HASS does not work. My guess is that HASS sends “220” as a new target temperature and Tuya or the TRV rejects the order because the value is way higher than 30 Celcius (the max target value according to the TRV specs).

The bottom line, controlling these Siterwell TRVs from Tuya’s integration for Home Assistant is not an option.

I will keep you up to date.

I had some progress.

I create a tuya developer account and followed the instructions to register a new IoT device. The tuya web gui show a wizard to help me choose the features I would like to include on my device. It even generate me code to customize and then flash on my device.

In this generates assets I found a very useful pdf document in which my selected commands are described in detail.
I immediatelly noticed some similarities with the raw data I capture (which at this point I have printed on my retina).

For example, for the change mode command send from the TRV module I got the following (decrypted) raw data:

00 3e 04 04 00 01 02

And this is what the generated document says:

ID Function name Header version Command word Data length dpID Data type Function length Function command Checksum
2 Mode Module send 0x55aa 0x02 0x04 0x00 0x05 0x02 0x04 0x00 0x01 auto:0x00 manual:0x01 eco:0x02 Checksum

Do you notice how the captured data matches the table?

Data length?? dpID?? Data type Fn length Value
00 3e 04 04 00 01 02

I took several samples of the packets transmitted when different actions take place on the App and manually from the TRV. I will proceed to re-flash the normal firmware on my cc2531 and test my findings.

Wish me good luck.

You’ve made big progress here! :slight_smile:
If you’d need any help decoding/matching dumps to commands, please just ask.

I haven’t bought thermostat yet… but I’d like very much.

1 Like

I just wanted to inform you that I successfully managed to control the TRV from Home Assistance using zigbee2mqtt.

I was able to map most of the commands supported by the device. All the commands/actions except 2 which, honestly, I don’t know what the fuck they mean. The only two commands I didn’t sniff were “config pending” and “fault”. Maybe these are those, or maybe not. The important commands that I already can control are:

  • Set target temperature
  • Change mode (off/antifreeze, heat, and auto)
  • Enable/disable window detection
  • Enable/disable valve detection (although I don’t know what this means)
  • Enable/disable child lock

I’ll create the merge request with my implementation to the zigbee2mqtt author to review it. But that later. I’m tired right now.

4 Likes

All my pull requests were merged. The implementation of the Siterwell GS361 valves will probably be included in the next zigbee2mqtt release.

Before you rush to buy these valves I have to warn you though. The main and only complaint I have about these devices is that sometimes their reaction time is very slow. This is a problem I noticed when I was using the Tuya gateway with the Siterwell UI. The same delay is present using zigbee2mqtt.

When the Zigbee coordinator (zigbee2mqtt) sends an order, the TRV takes between 1 to 30 seconds to execute and reply, The reason for this delay is still unknown to me.

I also noticed that the TRVs sends to the Coordinators all their commands repeated 3 times. This happens even if both devices 20 cm appart. It may be that the waiting time for the acknowledges of the messages is too short. This is imperceptible for the final user. It’s just a curious detail. I use the “debounce_ignore” and “debounce” zigbee2mqtt options per device to avoid firing 3 mqtt messages in a row.

5 Likes

Hi Daniel,
Super work for this integration of these TRV to zigbee2mqtt.
I have been looking at this type of valve for a while. I of course came across the model that you integrated and also on these 2 other models:

The 2 models work with the Tuya gateway. Do you think these models can be integrated like the Siterwell GS361 trv?

I don’t think so. The implementation will be very similar thought.

It’s possible that only the dp codes (the codes that identify the actions) will be different.

Soon I will publish an article explaining what I did to reverse engineered the implementation of this tuya-based TRV.

1 Like

Thank you for your return I look forward to your article.

I had planned to write 3 articles but then I received a shit-ton of work and I couldn’t finish the 3rd article describing how to teach zigbee2mqtt to interact with a new device. Hopefully, I will do it soon.

4 Likes

Looks great, any clue how this Tuya thermostat hardware compares to competitors? For example how is your experience with the battery life? I noticed in one of your screenshots it said 75% after how long was this?

After 1 week of heavy use @KVaak While I was learning how to decode the messages I had to interact with it a lot.

This is the current status of the batteries AAx2 that came with the device.

Capture

They arrived on March 4th. The radiator of the living room reached 75% since that day. Probably that one was not used during my tests.

My Home Assistant sends orders to them at least twice per day. I have 4 automations to change the temp during day, night and when a window in the room is open or close. Do you estimations with that.

I have two complaints about this device thought.

  1. Sometimes the orders take time to be executed on the devices. This also happen with the original Siterwell software. So I think is not fault of zigbee2mqtt.
  2. The idea to press to turn on and then use the circle to change temperature is not very intuitive. Sometimes you press the device and you ended changing the “mode”. It has 3 modes and the icons that identify them are not very descriptive. I keep the child-lock enabled in all of them and use HASS to control them. That way I avoid change their config by mistake.

Thank you very much for these first 2 articles Daniel I look forward to the last

Great work @dzegarra, that’s amazing!

Just to verify:
If I buy the same thermostats as you have I won’t need to sniff the traffic since you already submitted your code upstream, right?
I can just use zigbee2mqtt to listen to / control them directly? (I don’t use HA)

And if I contact the supplier you linked and ask them for the “Siterwell GS361A-H04 Zigbee 3.0 version” I should end up with the same device you have?
https://www.alibaba.com/product-detail/Manufacture-Reddot-design-award-Bluetooth-Z_60782820931.html?bypass=true

Hi @marco.brieden. The support for this thermostat was included in the version 1.12.1 of Zigbee2Mqtt. It should work just after pairing the device. The current version is 1.13.1.

I didn’t specify the version of the devices to the seller. I was not even aware that there was more than one version. :smile:

The support of Zigbee2Mqtt for this device was partially broken in the version 1.13.0.

If you use the last version of Zigbee2Mqtt you won’t be able to get and set the heating mode from HASS by using the MQTT discovery integration. If you use the previous version (1.12.2) it will work fine.

I will submit a merge request to fix the bug as soon as I can. Currently, I’m quite busy.

Seems like someone tried to improve the functions that encode and decodes the data from Tuya devices and ended breaking the integration with home assistant.

2 Likes

Hi @dzegarra
I see you did great work on these TRVs! Thank you so much!
Is it working now with latest zigbee2mqtt version?
Does the TRV include one (or even maybe two) temperature and humidity sensor? Or do I need an extra external temperature sensor to place in the same room?
By the way, is it a direct integration of the TRV or does the data goes to Tuya cloud?

I’m still using the version 1.12.2. I didn’t try to update it yet. Maybe the problem was already solved.

The TRV has its own temperature sensor. It does a good job. I have an electronic thermometer in one of the rooms and it usually has +/- 1 degree of difference with the temperature reported by the TRV.

The TRV uses only the Zigbee protocol. It communicates directly with the zigbee2mqtt coordinator which uses MQTT to interact with Home Assistant. No Tuya Cloud involvement. You don’t even need Wifi/Ethernet to make it work.

1 Like

Awesome! You convinced me of buying it! I will start with no other temperature sensor, and see how it goes. Thank you @dzegarra