Closed prestonr83 closed 2 years ago
By setting cool/heat are you referring to the "Mode" in the Flair app? If so, this is done by sending a PATCH request to a given "Structure" at the /api/structures/structure_id endpoint with:
{"data":{"type":"structures","attributes":{"structure-heat-cool-mode":"heat"}}}
---> this can be heat, cool, auto, or float (float corresponds to off).
Just a heads up, switching the mode would only work if within the app you set the Set Point Controller to "Flair App" ( This can be found under Home Settings --> System Settings --> Set Point Controller).
Regarding the power - your code is setting the room to inactive/active and not the puck. If there is an option to specifically set the puck on/off in the Flair app then that endpoint can be obtained, but I don't see that as an available option.
I will add your request as a milestone for the future. As of now I'm planning to rewrite the base library for it to be asynchronous followed by a rewrite of the Flair Home Assistant integration. I will add this functionality during the rewrite, but recommend using your method in the meantime.
@prestonr83 The ability to change structure mode has been introduced in 0.0.5.0. That should take care of what you're trying to do.
Currently you cannot set cool/heat or power for puck. I know you mentioned the API doesn't expose that but perhaps you could implement with rest calls. I haven't coded much in python in a long time and I'm not familiar with the HA scaffolding for integrations.
I do know the rest calls work as I have hacked a switch together so I can power off my AC with automation but would be great to have it seamless with this integration.
Example