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

Improved sysytem_mode/preset handling #1864

Merged
merged 1 commit into from Dec 7, 2020

Conversation

drzony
Copy link
Contributor

@drzony drzony commented Dec 6, 2020

No description provided.

@drzony
Copy link
Contributor Author

drzony commented Dec 6, 2020

@Koenkk A few words of explanation:

  1. Home Assistant seems to display 'auto' system_mode as schedule: image
  2. Saswell thermostats have schedule on a separate DP ID, so it's possible to make it work
  3. TS0601_thermostat has schedule as one of the presets, so it will be a bit more difficult to do it as system_mode, I'll look into this later.
  4. Any input about doing point 3 would be welcome (do we want to keep it as preset or do some weird logic to make it work HA style?)

@Koenkk
Copy link
Owner

Koenkk commented Dec 6, 2020

@drzony
Copy link
Contributor Author

drzony commented Dec 6, 2020

"Schedule" in terms of the thermostats == "auto" in terms of HA.
Yes this can be merged it works, I just translate "schedule on"/"schedule off" into "auto"/"heat".
The issue is with other TuYa based thermostats which have no "schedule on"/"schedule off", but they have "schedule" in their list of presets. So the logic there would be:
From zigbee:

if preset_in == 'schedule'
  return system_mode = 'auto' to HA
else
  return preset = preset_in to HA

toZigbee:

if system_mode == 'auto'
  send preset = 'schedule' to device
else
  send system_mode to device or ignore it (this logic needs some thinking)

This PR only concerns Saswell TRVs which work correctly with the included logic (not the one above)

@Koenkk
Copy link
Owner

Koenkk commented Dec 7, 2020

Thanks for the explanation!

@Koenkk Koenkk merged commit df32518 into Koenkk:master Dec 7, 2020
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.

None yet

2 participants