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

tuya_thermostat (TS0601): modes changed to presets and two other fixes #1464

Merged
merged 12 commits into from
Aug 14, 2020
Merged

tuya_thermostat (TS0601): modes changed to presets and two other fixes #1464

merged 12 commits into from
Aug 14, 2020

Conversation

mgrom
Copy link
Contributor

@mgrom mgrom commented Aug 11, 2020

This PR is related to: Koenkk/zigbee2mqtt#4070

  • window detection fix - before there was no way to change this value through mqtt command,
  • changed preset to away preset params - something named preset was actually away preset mode params (temp, and duration in days),
  • modes changed to presets - modes in home assistant are fixed, so the best to be flexible is to use presets (ha calls them hold_modes)

@Koenkk
Copy link
Owner

Koenkk commented Aug 11, 2020

I've just merged #1461 which conflicts with this pr, can you rebase this pr?

Note to self: after this merge Koenkk/zigbee2mqtt#4070

@mgrom
Copy link
Contributor Author

mgrom commented Aug 12, 2020

No problem, I'll do it today.

@mgrom
Copy link
Contributor Author

mgrom commented Aug 12, 2020

@Koenkk I'm only a bit worried about this change:
7b0c659#diff-63bec0da09650ada978527cc004902e2R316
Because it can break currently working installations. As I mentioned in other PR, homeassistant is not allowing to add any custom system modes, so to be able to control mode we should use presets instead, which are more flexible.
But this change can make some damage for user who currently use this integration without homeassistant.
Any ideas how to proceed?

Maybe return both preset and system_mode in the same message like:

return {preset: utils.getMetaValue(msg.endpoint, model, 'tuyaThermostatPreset')[dataAsDecNumber],
   system_mode: utils.getMetaValue(msg.endpoint, model, 'tuyaThermostatSystemMode')[dataAsDecNumber],
};

@Koenkk
Copy link
Owner

Koenkk commented Aug 12, 2020

Returning both is fine!

@mgrom
Copy link
Contributor Author

mgrom commented Aug 13, 2020

I think it's ready @Koenkk

converters/fromZigbee.js Outdated Show resolved Hide resolved
@Koenkk
Copy link
Owner

Koenkk commented Aug 14, 2020

Thanks!

@Koenkk Koenkk merged commit 0dc631a into Koenkk:master Aug 14, 2020
@mgrom mgrom mentioned this pull request Aug 19, 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.

2 participants