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

Adding thermostat feature #358

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

andMaximus
Copy link

We recently bought a new house that comes with a WiFi thermostat which controls the electric floor heating in our bathroom. The make and model of which are Magnum MRC Remote control which is supported by an OEM white label Tuya application. Unfortunately this app does not directly integrate with HomeKit, therefore a Homebridge plugin was required. The current version of homebridge-tuya does not provide support for thermostat devices where custom names are provided to select specific heating schedules. In the case of our thermostat, AUTO runs the regular schedule, and MANUAL, FROST or HOLIDAY should be used to deviate from the regular programming.

This feature aims to solve this need by splitting out the operational state of the thermostat (heating vs. idle), and the currently active heating mode (schedule vs. override), and provides the option to use the devices own enumerations for each operating state

For our specific device MRC Remote control these are the required settings:

Function Name in config DP Possible Values
Heating indicator dpActive 118 "warming" (corresponds to idle) / "heating" (corresponds to heating)
Program status dpProgramState 103 "AUTO" / "MANUAL" / "FROST" / "HOLIDAY"
Desired temperature dpDesiredTemperature 102 temperature multiplied by 10
Current temperature dpCurrentTemperature 106 temperature multiplied by 10

@andMaximus
Copy link
Author

Just made some fixes to ensure that the state always updates as soon as the thermostat communicates new info

@iRayanKhan iRayanKhan self-requested a review February 16, 2022 16:22
@iRayanKhan iRayanKhan self-assigned this Feb 16, 2022
@iRayanKhan iRayanKhan added the newDevice Add support for a new device. label Feb 16, 2022
@andMaximus
Copy link
Author

@iRayanKhan We have to make some alterations regarding how dpActive & dpProgramState are handled, as the thermostat feature needs to work both with strings ("heating"/"warming") and boolean (true/false). Different thermostats report their operating mode in different ways (as can be seen in issue #333). Perhaps we can integrate this as toggles in the config-ui pane?

@andMaximus
Copy link
Author

@iRayanKhan I implemented a toggle so the user can pick either strings ("heating"/"warming") and boolean (true/false) compare for the state of the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
newDevice Add support for a new device.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants