Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New device support]: Aqara Smart Radiator Thermostat E1 (SRTS-A01) #13993

Closed
ccorderor opened this issue Sep 13, 2022 · 251 comments
Closed

[New device support]: Aqara Smart Radiator Thermostat E1 (SRTS-A01) #13993

ccorderor opened this issue Sep 13, 2022 · 251 comments
Labels
new device support New device support request stale Stale issues

Comments

@ccorderor
Copy link

ccorderor commented Sep 13, 2022

Link

https://www.aqara.com/eu/product/radiator-thermostat-e1

Database entry

{"id":80,"type":"EndDevice","ieeeAddr":"0x54ef441000128356","nwkAddr":12635,"manufId":4447,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.airrtc.agl001","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":769,"inClusterList":[0,1,3,64704,10,513],"outClusterList":[3,64704,513],"clusters":{"genBasic":{"attributes":{"appVersion":23,"modelId":"lumi.airrtc.agl001"}},"aqaraOpple":{"attributes":{"247":{"type":"Buffer","data":[3,40,30,5,33,1,0,10,33,75,16,13,35,23,8,0,0,17,35,1,0,0,0,101,32,0,102,41,250,10,103,41,140,10,104,35,0,0,0,0,105,32,100,106,32,0]},"625":1,"626":0,"627":0,"628":1,"629":0,"630":{"type":"Buffer","data":[4,62,1,224,0,0,9,96,4,56,0,0,6,164,5,100,0,0,8,152,129,224,0,0,8,152]},"631":0,"633":500,"634":0,"635":1,"636":0,"637":0,"638":0,"640":0,"1034":100}},"hvacThermostat":{"attributes":{"localTemp":2810,"occupiedHeatingSetpoint":2700}},"genPowerCfg":{"attributes":{"batteryVoltage":33}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":23,"hwVersion":1,"dateCode":"Apr 25 2022","swBuildId":"0.0.0_0023","zclVersion":3,"interviewCompleted":true,"meta":{"configured":1906590817},"lastSeen":1663048175699,"defaultSendRequestWhen":"immediate"}

Comments

The device is unsupported. I've created a basic external converter and am able to manually control the heating setpoint, but there are still many custom aqaraOpple messages to be implemented.

For the moment, I'm sure the aqaraOpple message with key id 626 is the antifreeze option (value 2 is on, value 0 is off)
aqaraOpple message with key id 625 is manually setting off the TRV (0 is off, 1 is on)

External converter

const definition = {
    zigbeeModel: ['lumi.airrtc.agl001'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'SRTS-A01', // Vendor model number, look on the device for a model number
    vendor: 'Xiaomi', // Vendor of the device (only used for documentation and startup logging)
    description: 'Aqara Smart Radiator Thermostat E1', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    fromZigbee: [fz.thermostat, fz.aqara_opple, fz.battery],
    toZigbee: [tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, tz.thermostat_control_sequence_of_operation,
            tz.thermostat_system_mode, tz.thermostat_keypad_lockout, tz.thermostat_occupied_heating_setpoint], // Should be empty, unless device can be controlled (e.g. lights, switches).
    exposes: [e.battery_voltage(), exposes.climate()
            .withSetpoint('occupied_heating_setpoint', 5, 30, 0.5, ea.STATE_SET).withLocalTemperature(ea.STATE)
            .withSystemMode(['off', 'auto', 'heat'], ea.STATE_SET)
            .withRunningState(['idle', 'heat'], ea.STATE)], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
    configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);
            await endpoint.read('genPowerCfg', ['batteryVoltage']);
        },
};

Supported color modes

No response

Color temperature range

No response

@ccorderor ccorderor added the new device support New device support request label Sep 13, 2022
@kirovilya
Copy link
Contributor

I have already added thermostat converters, but they are not complete. you can add/correct them as needed.

@ccorderor
Copy link
Author

I have already added thermostat converters, but they are not complete. you can add/correct them as needed.

Nice work!
I'll check it to see if you have already added the antifreeze and manual option.

Thanks :)

@kirovilya
Copy link
Contributor

I am named them 'away_preset_temperature' and 'preset'

@ste-fle
Copy link

ste-fle commented Sep 13, 2022

According to the product page, this thermostat can be linked to an external temperature sensor in the Aqara app. Is it possible to support this as well or is this allegedly based on some proprietary Aqara implementation?

@kirovilya
Copy link
Contributor

Yes, there is such a possibility.
The TH-sensor sends temperature data to the hub, and then the hub sends a control command to the thermostat. Only the command and data are proprietary :)
Example:
aa:71:13:44:04:8a:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:23:80:00
image

@ste-fle
Copy link

ste-fle commented Sep 13, 2022

Thanks! Could you explain this part a little further:
Only the command and data are proprietary :)
Does this mean it's theoretically possible to link to a sensor but in reality due to proprietary commands it's not?

@kirovilya
Copy link
Contributor

I think if understand the data format, then we can use other sensors.
This is not quite a link - this is some kind of external control based on data from the sensor.

@kirovilya
Copy link
Contributor

kirovilya commented Sep 13, 2022

I propose to think about how to parse the commands that the gateway sends to the thermostat: their structure and meaning.

send command "link sensor"
aa:71:31:44:00:70:02:41:2e:63:14:57:81:3d:04:54:ef:44:10:00:51:c6:68:00:15:8d:00:01:e4:21:8a:00:01:00:55:13:0a:02:00:00:64:04:ce:c2:b6:c8:00:00:00:00:00:01:3d:64:65
aa:71:34:44:01:6c:02:41:31:63:14:57:81:3d:05:54:ef:44:10:00:51:c6:68:00:15:8d:00:01:e4:21:8a:08:00:07:fd:16:0a:02:0a:c9:e8:b1:b8:d4:da:cf:df:c0:eb:00:00:00:00:00:01:3d:04:65
received 26.09* from TH sensor then send control
aa:71:13:44:02:8c:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:23:10:00
aa:71:13:44:03:8b:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:23:10:00
received 26.16* then send control
aa:71:13:44:04:8a:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:23:80:00
aa:71:13:44:05:89:05:41:10:00:15:8d:00:01:e4:21:8a:08:00:07:fd:00:00:00:01 - ?
received 26.68* then send control 
aa:71:13:44:06:88:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:26:c0:00
received 26.71*  then send control
aa:71:13:44:07:87:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:26:f0:00
received 27.24* then send control
aa:71:13:44:08:86:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:2a:40:00
send command "unlink sensor"
aa:71:1d:44:09:7b:04:41:1a:63:14:59:1d:3d:05:54:ef:44:10:00:51:c6:68:00:00:00:00:00:00:00:00:00:00:00:00

Partially I managed to understand the composition of the package.
For example:

aa:71:13:44:02:8c:05:41:10:00:15:8d:00:01:e4:21:8a:00:01:00:55:45:23:10:00

aa:71:13:44: - ?
02: - subsequence
8c: - backwards subsequence
05: - ? command ?
41: - type octetStr
10: - length 16
00:15:8d:00:01:e4:21:8a:00:01:00:55:45:23:10:00 - ?

aa:71:31:44:00:70:02:41:2e:63:14:57:81:3d:04:54:ef:44:10:00:51:c6:68:00:15:8d:00:01:e4:21:8a:00:01:00:55:13:0a:02:00:00:64:04:ce:c2:b6:c8:00:00:00:00:00:01:3d:64:65

aa:71:31:44: - ?
00: - subsequence
70: - backwards subsequence
02: - ? command ?
41: - type octetStr
2e: - length 46
63:14:57:81:3d:04:54:ef:44:10:00:51:c6:68:00:15:8d:00:01:e4:21:8a:00:01:00:55:13:0a:02:00:00:64:04:ce:c2:b6:c8:00:00:00:00:00:01:3d:64:65 - ?
here the second octetStr also has a familiar value - ieee temperature sensor address 54:ef:44:10:00:51:c6:68:

@0ip
Copy link

0ip commented Sep 13, 2022

Thank you @kirovilya for your contribution! I'm using the thermostat with the latest dev branch.
Please excuse my question. Do we know if local_temperature really corresponds to the measured temperature the thermostat uses to adjust the valve or rather the internal SoC temperature or something else? I'm asking because my reading is far off from other temp sensors in the room, knowing full well that the value at the radiator can of course differ, but for me the value makes no sense. After all, my device could also be broken :D

Edit: My first device actually had a defective temperature sensor.

@kirovilya
Copy link
Contributor

@0ip as far as I understand, these are the readings of the internal temperature sensor, according to which the thermostat is adjusted

@trullock
Copy link

trullock commented Sep 20, 2022

Just checking in to request this device be added. I'm happy to help test things - how do I switch my HA addon installation to the dev branch without losing all my existing devices/config? cheers

@ste-fle
Copy link

ste-fle commented Sep 24, 2022

Any news on this? I just received and installed my thermostat as well, so I'd also help if possible/necessary.

@lunatik98
Copy link

Thanks for your work.
Currently turning the device on or off from Home Assistant does not actually turn on or off the thermostat in Z2M. But it works fine from Z2M.

@lunatik98
Copy link

Just checking in to request this device be added. I'm happy to help test things - how do I switch my HA addon installation to the dev branch without losing all my existing devices/config? cheers

Just stop the normal Z2M, copy the settings from the addon to the dev version and start it :)

@trullock
Copy link

trullock commented Oct 1, 2022

One issue I've found is that when you change the set point to either above or below the current temperature, and you hear the physical valve open/close, the valve state switch doesn't update, meaning you cant know if its open or not (without making an assumption from the temperature difference)

@artem-sedykh
Copy link

artem-sedykh commented Oct 3, 2022

[aa:71]:[13]:44:2b:63:05:41:10:[00:15:8d:00:04:44:c8:24]:00:01:00:55:[45:19:60:00]
[aa:71]                               : const
[13]                                    : data offset
[00:15:8d:00:04:44:c8:24] : zbee_nwk.src64(temperature sensor)
[45:19:60:00]                     : temperature (type float)

@artem-sedykh
Copy link

image
Frame Length 79.txt

@trullock
Copy link

trullock commented Oct 3, 2022

Not sure if this is useful, here's an unhandled message (247/0xf7) that I receive

 2022-10-03 20:30:42Received Zigbee message from 'Radiator', type 'attributeReport', cluster 'aqaraOpple', data '{"247":{"data":[3,40,21,5,33,1,0,10,33,21,178,13,35,25,8,0,0,17,35,1,0,0,0,101,32,0,102,41,108,7,103,41,96,9,104,35,0,0,0,0,105,32,100,106,32,0],"type":"Buffer"}}' from endpoint 1 with groupID 0

@artem-sedykh
Copy link

artem-sedykh commented Oct 3, 2022

send command "link sensor"

const data offset const subsequence backwards subsequence command const data length data block
aa:71 31 44 63 0d 02 41 2e
constrnd?constdevice addresssensor addressconstconst
633b:38:fd3d:0454:ef:44:10:00:51:cf:e600:15:8d:00:04:44:c8:2400:01:00:5513:0a:02:00:00:64:04:ce:c2:b6:c8:00:00:00:00:00:01:3d:64:65
aa:71 34 44 64 09 02 41 31
constrnd?constdevice addresssensor addressconstconst
633b:38:fd3d:0554:ef:44:10:00:51:cf:e600:15:8d:00:04:44:c8:2408:00:07:fd16:0a:02:0a:c9:e8:b1:b8:d4:da:cf:df:c0:eb:00:00:00:00:00:01:3d:04:65
aa:71 12 44 65 29 05 41 10
sensor addressconsttemperature(float)
00:15:8d:00:04:44:c8:2400:01:00:5545:1a:b0:00

@duvholt
Copy link

duvholt commented Oct 4, 2022

Header

The header for all commands on 0xfff2 is described here: https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Aqara-S1-Smart-Scene-Panel-Protocol#general-commands-structure

Command Start Command category CMD Size CMD Type Counter Integrity CMD Action Data Type Params Size
aa 71 31 44 10 60 02 41 2e

I wrote a quick implementation of this:

const aqaraHeader = (counter, params, action) => {
    // Based on https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Aqara-S1-Smart-Scene-Panel-Protocol
    const header = [
        0xaa, // static
        0x71, // to device
        params.length + 3, // CMD Size (all params after integrity)
        0x44, // CMD Type
        counter, // Counter
    ];
    const integrity = 512 - header.reduce((sum, elem) => sum + elem, 0);
    return [
        ...header,
        integrity,
        action, // 0x02 for linking sensor, 0x04 for unlinking, 0x05 when setting temperature state
        0x41, // Octet string
        params.length, // Params size
    ];
};

Some more details about "link sensor":

Linking consists of two commands which are always sent in the same order. I'm not sure if both are required but at least one of them has to be sent before setting temperature state.
The first 4 hex codes are unix timestamp in seconds encoded as int. E.g. 0x6339bf17 => 1664728855 => Sun Oct 2 06:40:55 PM CEST 2022.

Link 1:

Timestamp Const Link 1 Device address Sensor address Const shared between first link and write temp state Const for link 1 Common between links Const link 1 End
63:39:bf:0e 3d 04 54:ef:44:10:00:51:c2:5a 00:15:8d:00:07:f8:06:22 00:01:00:55 13:0a:02:00:00:64:04:ce:c2:b6:c8 00:00:00:00:00:01:3d 64 65

Link 2:

Timestamp Const Link 2 Device address Sensor address Const for link 2 Common between links Link 1(?) End
63:39:bf:0e 3d 05 54:ef:44:10:00:51:c2:5a 00:00:00:00:00:00:00:00:00:00:00:00 08:00:07:fd:16:0a:02:0a:c9:e8:b1:b8:d4:da:cf:df:c0:eb 00:00:00:00:00:01:3d 04 65

Set external sensor temp

While reverse engineering the temperature I didn't realize that the value was encoded as float so I accidentally wrote a shitty implementation of floating point. Glad that never has to see the light of day. 😄
Instead we can just use this:

const value = 23.57;
const temperatureBuf = Buffer.allocUnsafe(4);
temperatureBuf.writeFloatBE(Math.round(value * 100));

temperatureBuf: <Buffer 45 13 50 00>
As a side note I find it weird that they use floating point instead of int here since they don't even use the fraction part.

When an external sensor temperature is set the TRV reports LocalTemperature with the specified temperature so it doesn't look like we have to any special handling here compared to using the internal sensor.

Unlinking (going back to internal sensor):

Looks like this time the commands are sent in opposite order (05 then 04).

Timestamp Const Link 2 Device address Const
63:39:bf:0e 3d 05 54:ef:44:10:00:51:c2:5a 00:00:00:00:00:00:00:00:00:00:00:00
Timestamp Const Link 1 Device address Const
63:39:bf:0e 3d 04 54:ef:44:10:00:51:c2:5a 00:00:00:00:00:00:00:00:00:00:00:00

Sending temperature in zigbee2mqtt

const params = [
  ...sensor,
  0x00, 0x01, 0x00, 0x55, // static?
  ...temperatureBuf,
];
const value = [
  ...(aqaraHeader(0x12, params, 0x05)),
  ...params,
];

await entity.write('aqaraOpple', {0xfff2: {value, type: 0x41}}, 0x115f);

I'm not sure if the sensor address actually matters but the same address has to be used when linking and when setting temperature. Likely we can get away with using a static address.
I'm also not sure if increasing the counter actually makes a difference as just using the same value does seemingly work. Might make a difference if commands are sent rapidly?

@nickagian
Copy link

One issue I've found is that when you change the set point to either above or below the current temperature, and you hear the physical valve open/close, the valve state switch doesn't update, meaning you cant know if its open or not (without making an assumption from the temperature difference)

May I ask which topic in MQTT you are using to check if the valve is open or closed? I don't seem to find this feature. I can only find the switch "Valve_detection", but I guess this is to enable/disable the feature of reading the valve state.

Is this generally supported by the device, to see valve state?

@trullock
Copy link

trullock commented Oct 4, 2022

One issue I've found is that when you change the set point to either above or below the current temperature, and you hear the physical valve open/close, the valve state switch doesn't update, meaning you cant know if its open or not (without making an assumption from the temperature difference)

May I ask which topic in MQTT you are using to check if the valve is open or closed? I don't seem to find this feature. I can only find the switch "Valve_detection", but I guess this is to enable/disable the feature of reading the valve state.

Is this generally supported by the device, to see valve state?

I'm not sure if this is a feature, but I'd expect it to be. I'm expecting the on/off switch to have its state updated if the valve determines it should be on/off automatically or through physical adjustment of the device. Is this not the case?

Valve Detection seems to be a badly named feature, and is really something else:

You can enable/disable the Valve Detection function on the settings page. In order to prevent the prolonged low-temperature or high-temperature state of room temperature from becoming uncomfortable, the thermostat will remind the user of temperature control abnormality when it detects that the room temperature can’t reach the set temperature, after heating is started, for the following possible causes:
The thermostat is not installed correctly. It is suggested that you should remove the battery and put it back 30 sec later, then reinstall the thermostat and calibrate it again, and further wait for a period of time, and then observe whether the fault is eliminated.
The room temperature is significantly higher than the set temperature due to the incorrect temperature setting. It is suggested that you should re-set the temperature again, wait for a period of time, and then observe whether the fault is eliminated.
Valve failure. Please replace the valve, reinstall the thermostat, and carry out valve calibration.
The room is too large (the radiator is not matching) or there is too much ventilation in the room. It is suggested that you should replace the radiator or test whether the room door or window is opened or leaking air.
The inlet water pressure or inlet water temperature is too low. Please check the inlet water pressure and inlet water temperature.
Upon networking with the temperature sensors, no linkage is established with the temperature sensor in the same room, or the distance from the temperature sensor to the radiator is remote (it is recommended that the temperature sensor should be placed in the same room with the thermostat, for a distance of 2-3m from the thermostat).

It might be helpful to either alude to this in the UI or otherwise completely rename it to something sensible

@ste-fle
Copy link

ste-fle commented Oct 5, 2022

Valve Detection seems to be a badly named feature, and is really something else:

You can enable/disable the Valve Detection function on the settings page. In order to prevent the prolonged low-temperature or high-temperature state of room temperature from becoming uncomfortable, the thermostat will remind the user of temperature control abnormality when it detects that the room temperature can’t reach the set temperature, after heating is started, for the following possible causes:

The thermostat is not installed correctly. It is suggested that you should remove the battery and put it back 30 sec later, then reinstall the thermostat and calibrate it again, and further wait for a period of time, and then observe whether the fault is eliminated.

The room temperature is significantly higher than the set temperature due to the incorrect temperature setting. It is suggested that you should re-set the temperature again, wait for a period of time, and then observe whether the fault is eliminated.

Valve failure. Please replace the valve, reinstall the thermostat, and carry out valve calibration.

The room is too large (the radiator is not matching) or there is too much ventilation in the room. It is suggested that you should replace the radiator or test whether the room door or window is opened or leaking air.

The inlet water pressure or inlet water temperature is too low. Please check the inlet water pressure and inlet water temperature.

Upon networking with the temperature sensors, no linkage is established with the temperature sensor in the same room, or the distance from the temperature sensor to the radiator is remote (it is recommended that the temperature sensor should be placed in the same room with the thermostat, for a distance of 2-3m from the thermostat).

It might be helpful to either alude to this in the UI or otherwise completely rename it to something sensible

This function can show an icon on the thermostat screen in case one of the conditions above fires. The manual refers to this as "fault icon". So maybe this function / switch should rather be called something like "fault detection" in combination with further documentation (e.g. the conditions above) and that this enables this icon on the screen.

@trullock
Copy link

trullock commented Oct 5, 2022

This function can show an icon on the thermostat screen in case one of the conditions above fires. The manual refers to this as "fault icon". So maybe this function / switch should rather be called something like "fault detection" in combination with further documentation (e.g. the conditions above) and that this enables this icon on the screen.

I think if anything is done here it should be additive, e.g. call it "Fault (Valve) Detection", as renaming it alone creates a mismatch between feature names which is arguably more confusing - Whos to know theyre the same feature and not different features?

@nickagian
Copy link

One issue I've found is that when you change the set point to either above or below the current temperature, and you hear the physical valve open/close, the valve state switch doesn't update, meaning you cant know if its open or not (without making an assumption from the temperature difference)

May I ask which topic in MQTT you are using to check if the valve is open or closed? I don't seem to find this feature. I can only find the switch "Valve_detection", but I guess this is to enable/disable the feature of reading the valve state.
Is this generally supported by the device, to see valve state?

I'm not sure if this is a feature, but I'd expect it to be. I'm expecting the on/off switch to have its state updated if the valve determines it should be on/off automatically or through physical adjustment of the device. Is this not the case?

Valve Detection seems to be a badly named feature, and is really something else:

You can enable/disable the Valve Detection function on the settings page. In order to prevent the prolonged low-temperature or high-temperature state of room temperature from becoming uncomfortable, the thermostat will remind the user of temperature control abnormality when it detects that the room temperature can’t reach the set temperature, after heating is started, for the following possible causes:
The thermostat is not installed correctly. It is suggested that you should remove the battery and put it back 30 sec later, then reinstall the thermostat and calibrate it again, and further wait for a period of time, and then observe whether the fault is eliminated.
The room temperature is significantly higher than the set temperature due to the incorrect temperature setting. It is suggested that you should re-set the temperature again, wait for a period of time, and then observe whether the fault is eliminated.
Valve failure. Please replace the valve, reinstall the thermostat, and carry out valve calibration.
The room is too large (the radiator is not matching) or there is too much ventilation in the room. It is suggested that you should replace the radiator or test whether the room door or window is opened or leaking air.
The inlet water pressure or inlet water temperature is too low. Please check the inlet water pressure and inlet water temperature.
Upon networking with the temperature sensors, no linkage is established with the temperature sensor in the same room, or the distance from the temperature sensor to the radiator is remote (it is recommended that the temperature sensor should be placed in the same room with the thermostat, for a distance of 2-3m from the thermostat).

It might be helpful to either alude to this in the UI or otherwise completely rename it to something sensible

I definitely agree with you. Something like is expected to be present from a smart thermostat, otherwise how can you monitor when it is operating or not?

@artem-sedykh
Copy link

image

@0ip
Copy link

0ip commented Oct 9, 2022

Now that we know how the linking procedure to an external temperature sensor works, thanks to @duvholt and others, should/can it be integrated into Z2M, or should that be left to applications built on top of Z2M?

@protyposis
Copy link
Contributor

  • Schedule seems to be turned on by a switch with the very non-descriptive name "state" in the zigbee2mqtt web ui.

For reference, this is broken since Koenkk/zigbee-herdsman-converters#6066, just like the "window detection" and "valve detection" states (labeled "State") and the "window open" flag (label missing).

  • Schedules seems to be set in UTC time, which is a bit inconvenient in regions with DST. However, even so the times when the set temperatur is switched seems to be off, at least if I look at the Homeassistant graphs for the thermostate.

This requires clock synchronization, which isn't implemented yet (example from pet feeder: Koenkk/zigbee-herdsman-converters#5364), and also regular re-synchronization to avoid time drift.

  • There are only four time schedules possible. This crucial information is also missing in the docs.

This is described in the user manual of the device, hinted by the description in the Z2M UI, and also enforced by the validator when changing the schedule. But you are right, it could be described more precisely.

  • I would also like to know the syntax for implementing different schedules on different days of the week.

This isn't possible directly on the device. The recommended approach is using HA (or any other home automation system) to program advanced schedules.

@kzajac83
Copy link

kzajac83 commented Oct 3, 2023

@protyposis thank you for your answer, seems few topic has been properly addressed but have one more topic.

In another smart radiator thermostat from Aqara E1, I had a function called "anti-calcification valve system" and idea is if last change position of valve was more then 7 days then made full open-close valve move to prevent making calcification inside the valve.

Similar functionality is here? If no then is possible add such functionality in Z2M?

@DaN66O
Copy link

DaN66O commented Oct 3, 2023

Schedule switch in frontend z2m works but it doesn't work in home assistant.
If the schedule is turned on in z2m, then this switch will also turn on in the home assistant.
But this can't be done in home assistant.
Screenshot_33

An attempt to enable it in the home assistant results in an error:

Error 2023-06-19 22:20:19 No converter available for 'state' ("ON")

And in general it is not clear that this switch is responsible for the schedule.

@protyposis
Copy link
Contributor

@kzajac83 This thermostat doesn't seem to have this functionality, thus it can't be added to Z2M. You can implement a workaround automation in HA though to force the valve to move. Unfortunately it can't be done conditionally, i.e., only if the valve didn't move, because the thermostat doesn't expose the valve position, so there is no way to actually figure out whether the valve moved.

  • Simplest way: Trigger every 7 days to set system mode to "off", wait a few seconds (await valve movement), then back to "heat".
  • With full open-close movement: store current heating setpoint, then set it to the highest value, wait a few seconds, set to lowest value, wait a few seconds, restore original setpoint.

@DaN66O
Copy link

DaN66O commented Oct 3, 2023

And some nonsense with the battery readings ....
This is misleading
Screenshot_34
And on the other hand, this is
Screenshot_35

@washdoc
Copy link

washdoc commented Oct 17, 2023

Schedule switch in frontend z2m works but it doesn't work in home assistant. If the schedule is turned on in z2m, then this switch will also turn on in the home assistant. But this can't be done in home assistant. Screenshot_33

An attempt to enable it in the home assistant results in an error:

Error 2023-06-19 22:20:19 No converter available for 'state' ("ON")

And in general it is not clear that this switch is responsible for the schedule.

trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: switch
      service: turn_off
      service_data:
        entity_id: switch.termostat_schedule
    id: Schedule off
  - platform: event
    event_type: call_service
    event_data:
      domain: switch
      service: turn_on
      service_data:
        entity_id: switch.termostat_schedule
    id: Schedule on
action:
  - if:
      - condition: trigger
        id:
          - Schedule off
    then:
      - service: mqtt.publish
        data:
          qos: 0
          retain: true
          topic: zigbee2mqtt/xxxx/set/schedule
          payload: "OFF"
  - if:
      - condition: trigger
        id:
          - Schedule on
    then:
      - service: mqtt.publish
        data:
          qos: 0
          retain: true
          topic: zigbee2mqtt/xxxx/set/schedule
          payload: "ON"

@kzajac83
Copy link

From 31 Jun the issue is closed, not sure our talks is visible in some dashboard / notifications for developers point of view.

@Koenkk can you please re-open the issue or maybe suggest something else? General we have few problems with Aqara E1 thermostat (SRTS-A01)

@groenmarsmannetje
Copy link

From 31 Jun the issue is closed, not sure our talks is visible in some dashboard / notifications for developers point of view.

@Koenkk can you please re-open the issue or maybe suggest something else? General we have few problems with Aqara E1 thermostat (SRTS-A01)

This doesn't make sense. This item was created to initially make the device work. That has been delivered. If you experience any new issues you should create new problem tickets for that, so that these can be individually be looked into, tracked and solved.

@ooii
Copy link

ooii commented Nov 2, 2023

Hi,
What's the latest firmware version of this device please? I'm still looking for hvac_action report.
Thanks.

@kzajac83
Copy link

kzajac83 commented Nov 2, 2023

0.0.0_01030

@helgek
Copy link

helgek commented Nov 19, 2023

@kzajac83 This thermostat doesn't seem to have this functionality, thus it can't be added to Z2M. You can implement a workaround automation in HA though to force the valve to move. Unfortunately it can't be done conditionally, i.e., only if the valve didn't move, because the thermostat doesn't expose the valve position, so there is no way to actually figure out whether the valve moved.

  • Simplest way: Trigger every 7 days to set system mode to "off", wait a few seconds (await valve movement), then back to "heat".
  • With full open-close movement: store current heating setpoint, then set it to the highest value, wait a few seconds, set to lowest value, wait a few seconds, restore original setpoint.

@protyposis @kzajac83 In the latest Z2M version I can run the calibration command. This does a full open and close movement.

@ferdinandSoethe
Copy link

This may be a dumb question but ...
How do I set the current target temperature for this device with homeassistant?
I'm trying to write an automation that changes the target temp controlled by a schedule but I can't identify the entity for the target temp.

Thanks for your help,
Ferdinand

@RomchikL
Copy link

This may be a dumb question but ... How do I set the current target temperature for this device with homeassistant? I'm trying to write an automation that changes the target temp controlled by a schedule but I can't identify the entity for the target temp.

Thanks for your help, Ferdinand

e.g.

      - alias: lr_aqara_e1_temp_schedule
        id: lr_aqara_e1_temp_schedule
        description: Smart schedule Aqara E1
        initial_state: true
        trigger:
         - platform: time
           at: "06:00:00"
           id: "06"
         - platform: time
           at: "07:00:00"
           id: "07"
        action:
          - if:
             - "{{ is_state('binary_sensor.workday_sensor', 'off')  }}" 
            then: 
              - choose:
                - conditions:
                    - condition: trigger
                      id: "06"
                  sequence:
                    - service: climate.set_temperature
                      data:
                        entity_id: climate.0xXXXXXXXXXXXXX
                        temperature: 23
                - conditions:
                    - condition: trigger
                      id: "07"
                  sequence:
                    - service: climate.set_temperature
                      data:
                        entity_id: climate.0xXXXXXXXXXXXXX
                        temperature: 22 
                 ...
            else:                                       
              - choose:
                - conditions:
                    - condition: trigger
                      id: "06"
                  sequence:
                    - service: climate.set_temperature
                      data:
                        entity_id: climate.0xXXXXXXXXXXXXX
                        temperature: 23
               ...

@ferdinandSoethe
Copy link

Thank you so much, works like a charm.

@helgek
Copy link

helgek commented Nov 23, 2023

I now had this for the second time with two different devices out of my four E1 TRVs: The device successfully sends updates to Z2M when I make changes on the TRV itself but commands from Z2M to the TRV don't work anymore. Error message in Debug mode is as follows:

Publish 'set' 'window_detection' to 'Heating Living Room' failed: 'Error: Write 0x54ef44100073c510/1 aqaraOpple({"627":{"value":0,"type":32}}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4447,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 23060 - 1 - 91 - 64704 - 4 after 10000ms)'

This unidirectional situation of the device speaking with Z2M but Z2M not being able to speak to the TRV has also not changed after waiting for a day. Very frustrating since my TRVs are set to "external" temperature and because the last temperature value the half-lost TRV had received was below the set target temperature of the TRV. Because of this it heated continuously throughout the day until I came home and was able to intervene.

Anyone with similar issue and is somebody able to interpret this error message? The TRV concerned this time is just 2 meters away from my SLZB-06 coordinator (which acts perfectly well with 60 devices in my network, including some repeaters, and no devices ever get lost except those Aqara TRVs sometimes; also the Zigbee channel is set to 15 to make the network even more robust, but anyway this doesn't really look like a network issue to me but maybe more like a protocol issue (?)).

Thanks!

Found this similar but very pretty old issue where the coordinator firmware seemed to have been the issue: Zigbee2MQTT Aqara E1 TRV publish set error using Sonoff Zigbee Dongle Plus V2 (Dongle-E)

@Ra72xx
Copy link

Ra72xx commented Nov 23, 2023

Mayber #19747

@helgek
Copy link

helgek commented Nov 23, 2023

@Ra72xx Thank you. My error message has the timeout in it, I couldn't find this in the debug log in the issue you referenced. Nevertheless the general error pattern is similar.

@canassa
Copy link

canassa commented Dec 1, 2023

@kzajac83 This thermostat doesn't seem to have this functionality, thus it can't be added to Z2M. You can implement a workaround automation in HA though to force the valve to move. Unfortunately it can't be done conditionally, i.e., only if the valve didn't move, because the thermostat doesn't expose the valve position, so there is no way to actually figure out whether the valve moved.

  • Simplest way: Trigger every 7 days to set system mode to "off", wait a few seconds (await valve movement), then back to "heat".
  • With full open-close movement: store current heating setpoint, then set it to the highest value, wait a few seconds, set to lowest value, wait a few seconds, restore original setpoint.

@protyposis @kzajac83 In the latest Z2M version I can run the calibration command. This does a full open and close movement.

May I ask how do you run that command?

@bemo47
Copy link

bemo47 commented Dec 13, 2023

Hi, not sure to understand all wait is writtent all above but i think my issue is related with this post. I have an AQARA E1 valve connected to a Zigbee anntenna managed in HA with Z2M.
I also have a Sonoff temperature control, and i would like to link the E1 to this external temp device instead of its own internal temp source.
I found the external temp attribute which i set to external.
But can we link it to a specific temp device ? Via Linking in Z2M ?

@Ra72xx
Copy link

Ra72xx commented Dec 13, 2023

I don't know about direct linking, but you can also use HA automations like this one:
https://community.home-assistant.io/t/z2m-aqara-trv-e1-link-external-temperature-sensor/609689
Basically it's just publishing the sensor's temperature state to a certain MQTT topic.

@bemo47
Copy link

bemo47 commented Dec 13, 2023

Thanks, so should i just add this code to the yaml of the E1 valve ?
And adapt all references to my configuration, mainly the temp sensor name ...

Edit : but i see that this is a blueprint... so i just added the blueprint (i am a real beginner...) , it seems added now, oh and working !!! here below on left temp from external sensor, right remp noticed by the E1 Valve !!! Seems fully ok !! Thanks a lot
image

@bemo47
Copy link

bemo47 commented Dec 13, 2023

so now, i will have a second question, not sure if i am in the right post, how to create schedules for the TRV, i saw some posts about that but with some code, and i don't understand how i can implement that. I would like to have different temp target for different hours in the day, or for different days also.

@Ra72xx
Copy link

Ra72xx commented Dec 14, 2023

The scheduler integrated in the thermostat is very limited. So look at either the "schedule helper" which is integrated in HA, or use some custom (HACS) scheduler component. This is, however, a Homeassistant topic, but all these options are well documented. You might also be interested in something like this: https://github.com/jmcollin78/versatile_thermostat

@nlincke
Copy link

nlincke commented Mar 30, 2024

0.0.0_01030

Am i wrong or ist the latest firmware version for this device 259 ?

@mmirannalti
Copy link

Hi everyone.
Any idea if the device is exposing the state of the valve (open, close, percentage)?
If yes, any plan to implement it in z2m?

I would find it very useful to be able to estimate and monitor energy consumption.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request stale Stale issues
Projects
None yet
Development

No branches or pull requests