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

Aqara SRTS-A01 smart schedule #5058

Merged
merged 20 commits into from
Feb 7, 2023

Conversation

protyposis
Copy link
Contributor

@protyposis protyposis commented Dec 1, 2022

Add smart scheduling support for Aqara Smart Radiator Thermostat E1 (SRTS-A01). This is a refactored and improved version of the stale #4763.

This adds the following:

  • schedule: A toggle to turn on/off the smart schedule.
  • schedule_settings: A string representation of the schedule settings. Example (default): mon,tue,wed,thu,fri,sat,sun|8:00,24.0|18:00,17.3|23:00,22.0|8:00,22.0

I tried to expose the schedule as a configuration object which can be nicely managed through the frontend, but this is currently not possible due to various limitations (see discussion in #5058 (review)). Exposing it as a string is a first step to figure out if this is even useful.

A schedule consists of a selection of weekdays and exactly 4 events that set a specific temperature at a specific time. The temperatures of the first 3 events are those that can be controlled in the Aqara app, the last one is always set to the previous one in the Aqara app. I decided to explicitly expose it anyway, but I don't know if it's interpreted by the TRV.

I have successfully tested reading and writing the settings, and made sure the written data corresponds exactly to the factory-set data. However, I have not tested whether the schedule is actually executed by the TRV, i.e., if it actually works.

@0ip
Copy link
Contributor

0ip commented Dec 1, 2022

Thanks a lot for your effort! Really hope this PR makes it through.

Have you been able to work out how preset behaves when the schedule is active?

@protyposis
Copy link
Contributor Author

Have you been able to work out how preset behaves when the schedule is active?

Unfortunately not. I expected some dependencies, e.g., that the preset changes to auto when enabling the schedule, or the schedule enables when switching to auto, but I couldn't identify any such interdependencies. So I was actually hoping to merge this, gather feedback from users, and improve in a follow-up PR. Unless a motivated reviewer with the required knowledge comes along who investigates this.

@itsSaad
Copy link

itsSaad commented Dec 28, 2022

@protyposis This PR seems to be stuck same as #4763.
What needs to be done. Can I help you to unblock this PR.
I just acquired two of these TRVs and feel that many functionalities are missing.

  • Schedules

  • External Temp Sensor. UPDATE: This is working atm by setting the sensor to external and publishing a mqtt message to the topic: zigbee2mqtt/FRIENDLY_NAME/set with json value: {"sensor_temp": 21 }

  • No indication if the Valve is closed or open. I expected an idle hvac_action/system_mode.
    Not sure what other functionalities the aqara app has.

Im willing to test this if that will unblock this effort.

@protyposis
Copy link
Contributor Author

@itsSaad this PR is only about the schedule. Please discuss unrelated features elsewhere, e.g. in Koenkk/zigbee2mqtt#13993.

@itsSaad
Copy link

itsSaad commented Jan 3, 2023

@protyposis Im not discussing those but just mentioned them. My comment was mainly to offer help.

'When being ON, the thermostat will change its state based on your settings',
ea.ALL, 'ON', 'OFF'),
exposes.text('schedule_settings', ea.ALL)
.withDescription('Smart schedule configuration (also exposed as JSON object through "schedule_settings_json")'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an example to the description?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@@ -0,0 +1,233 @@
function readTemperature(buffer, offset) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this file into

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved

@Koenkk
Copy link
Owner

Koenkk commented Jan 29, 2023

@protyposis I left two minor comments, after that it is ready for merge. Can you also fix the merge conflict?

@protyposis protyposis requested a review from Koenkk February 7, 2023 07:56
@Koenkk Koenkk merged commit e20864c into Koenkk:master Feb 7, 2023
@Koenkk
Copy link
Owner

Koenkk commented Feb 7, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants