My Flair HVac Unit

The Unofficial SmartThings Blog
Jump to: navigation, search

Portable AC 2000x1500-556.png Minisplit 1000 turned 2000x1500-556.png Window AC 2000x1500-556.png


Brand:Flair

Models:HVAC Units (MiniSplit/Window Units, Portable heaters/coolers

Type: Smart climate-control in every room for Mini Splits/Window Units and Portable heater/coolers.

Protocol: Wi-Fi to the puck gateway, IR to the devices

Link to Flair website [1]

Device Type Author:Yves Racine

ST Community handle http://community.smartthings.com/users/yvesracine/activity

Company Link: http://www.ecomatiqhomes.com#!home/mainPage



Contents

Contribution is required

The Flair devices have required hundreds of hours of development & testing efforts to build, so a mandatory contribution is required to get the code.


To download the code, go to

http://www.ecomatiqhomes.com/store

Technical support packages are also available.


If you want to contribute more, here is the paypal link below.

https://paypal.me/ecomatiqhomes

Prerequisites

  • Puck gateway operational & connected to Flair via wi-fi
  • Flair Setup completed: basic information about your home & rooms entered via the Flair Mobile App or the Flair portal
    see setup video here: https://www.youtube.com/watch?v=Cg_rPqM8o8k
  • IR codeset downloaded for the HVAC unit to the Puck device
  • IR setup at the Puck fully operational (you can test it using the Flair Mobile app)
  • Flair HVAC Unit operational & connected to Flair via the Puck gateway
  • SmartThings hub fully operational
  • Use of the SmartThings classic mobile app for instantiation of the custom devices (only the basic attributes will display within the new Samsung Connect mobile app as ST is working on the required migration steps).

Article(s) in the media

  https://flair.co/blogs/news/flairs-open-culture-and-platform

Information

  • Functionality:Works with your central heating and cooling system to eliminate uneven room temperatures across your home by automatically controlling how much air goes to each room.
  • Support of US and metric scale systems (Celsius, Fahrenheit, etc)



Here is a list of ST Capabilities

   capability "Thermostat"
   capability "ThermostatHeatingSetpoint"
   capability "ThermostatCoolingSetpoint"
   capability "ThermostatSetpoint"
   capability "ThermostatMode"
   capability "ThermostatFanMode"
   capability "ThermostatOperatingState"        
   capability "Temperature Measurement"
   capability "Switch"
   capability "Polling"
   capability "Refresh"
   capability "Sensor"
   capability "Actuator"
   capability "Health Check"


  • Here is the complete list of commands (see the signature in the DTH code, next to command's implementation for details about parameters):
   command "getHvacUnitInfo"
   command "getHvacUnitStates"
   command "setHvacUnit"
   command "levelUp"
   command "levelDown"
   command "heatLevelUp"
   command "heatLevelDown"
   command "coolLevelUp"
   command "coolLevelDown"
   command "setThermostatFanMode"
   command "setThermostatFanSpeed"
   command "fanLow"
   command "fanMedium"
   command "fanHigh"
   command "fanOff"
   command "fanAuto"
   command "fanOn"
   command "swingOn"
   command "swingOff"
   command "swingTop"
   command "setSwingMode"
   command "getRoom"
   command "setRoom"
   command "setRoomType"
   command "setRoomLevel"
   command "setRoomUserDesiredTemp"
   command "setRoomSetpoint"
   command "setRoomTempAwayMin"
   command "setRoomTempAwayMax"
   command "setRoomHumidityAwayMin"
   command "setRoomHumidityAwayMax"
   command "setRoomPreHeatPrecool"
   command "setRoomFrozenPipePetProtect"
   command "setRoomAirReturn"
   command "setRoomActive"        
   command "setRoomAwayMode"
   command "setRoomPucksInactive"        
   
   command "getZone"
   command "getZonesList"
       


List of Attributes available for subscription (in any rule engine like CoRE/WebCoRE/SmartRules)

   attribute "structureId"
   attribute "hvacUnitId"
   attribute "hvacUnitName"
   attribute "hvacUnitMake"
   attribute "type"
   attribute "power"
   attribute "capabilities"
   attribute "makeId"
   attribute "codesetId"
   attribute "buttonPresses"
   attribute "swingMode"
   attribute "temperatureDisplay"
   attribute "coolingSetpointDisplay"
   attribute "heatingSetpointDisplay"
   attribute "thermostatFanSpeed"
   attribute "verboseTrace"
   attribute "hvacUnitOperatingState"        
   attribute "createdAt"
   attribute "updatedAt"
   attribute "hvacUnitData"       
   attribute "hvacUnitList"       
   attribute "hvacUnitStatesData"       

List of Room's Attributes available in My Flair HVAC Unit

   attribute "roomId"
   attribute "roomName"
   attribute "rmSetpoint"
   attribute "rmCurrentTemperature"
   attribute "rmUserDesiredTemperature"
   attribute "rmPreheatPrecool"
   attribute "rmTempAwayMin"
   attribute "rmTempAwayMax"
   attribute "rmHumidityAwayMin"
   attribute "rmHumidityAwayMax"
   attribute "rmHoldReason"        
   attribute "rmHoldUntil"        
   attribute "rmActive"        
   attribute "rmPucksInactive"        
   attribute "rmWindows"        
   attribute "rmAwayMode"        
   attribute "rmAirReturn"
   attribute "rmType"        
   attribute "rmLevl"        
   attribute "rmFrozenPipePetProtect"
   attribute "roomData"

List of Zones's Attributes available in My Flair HVAC Unit

   attribute "zoneList"
   attribute "zoneData"

Look & Feel

MyHVACUnitP1.png MyHVACUnitP2.png MyHVACUnitP3.png


UI Fields

Upper section of the multi-tile

  • Current switch status (On/Off)
  • HVAC unit Operating state (idle, cooling, heating, fan only)

Lower section of the multi-tile

  • Name of the HVAC unit
  • Fan mode (tap to change to on, auto)
  • Fan speed (tap to change to low, medium, high, auto)
  • Swing mode (tap to change to on, top, off)
  • Puck active or inactive status
  • Ambient temperature (in Fahrenheit or Celsius)
  • Setpoint temperature (in Fahrenheit or Celsius)
  • Up and Down arrows to control the Setpoint temperature (tap to change the setpoint)
  • Capabilities (heat, cool, both)
  • HVAC Unit Brand
  • HVAC Unit Type
  • Room where the Flair Vent is located
  • Zone names associated to the Vent
  • Google Graph that represents the HVACUnit mode,RoomTemperature,RoomDesiredTemperature,RoomSetpoint, On/Off power (0/1) over a period of time (week, last 24 hrs).

The button is used to change the view window (past week Vs. last 24 hrs).


Instructions for My Flair Device installation (readme): http://github.com/yracine/device-type.myFlair/blob/master/README.md

Known issues

.................................................................................................................................

The HTLMTile is not officially supported by SmartThings

.................................................................................................................................


My Flair HVAC Unit uses the HTMLtile for rendering the graph. As ST is not supporting the HTMLTile, it may not work properly on all devices. This is a ST UI platform issue and not related to my code per se.

It runs properly on all iOS devices (even the Ipod) when javascript is enabled. It is also supported now on all recent Android devices.

To enable javascript on your iOS device, refer to

http://activatejavascript.org/en/instructions/ios

Also, since v2.2.2 of the ST mobile app, most of the Android devices are now supported.

P.S. You can also visualize the graph in the IDE at any time (make sure that javascript is enabled too in your browser).

a) Go to https://graph.api.smartthings.com/ide/devices (or the equivalent shard)

b) Click on My Flair HVAC Unit, click on "simulator" on the right and the button under "API URL" as indicated below to launch the rendering.



MyEcobeeDeviceChartInIDE.png


Please contact SmartThings support for any issues related to HTMLtile on your devices.


.................................................................................................................................

Not all Flair API fields are populated or properly set by Flair

.................................................................................................................................

Some Flair API values are null or populated with zero values. Those fields are not mandatory and should not affect the general devices' behavior.


Please contact the Flair support if you have some issues with some null fields or fields not set by Flair properly as I'm sending the right commands on my side (according to the thin documentation available).

.................................................................................................................................

It's sometimes difficult to choose & set the right codeset for the IR device(s)

.................................................................................................................................


You have to choose the right codeset for your IR device using the Flair Mobile app and download it to your puck device.

The puck needs to be hardwired and close to the IR device to be controlled.

Sometimes, the IR device partially responds to the IR commands.

The SmartThings code will not work properly if the right IR codeset is not downloaded to the nearest puck.

Make sure to test all your IR supported Commands (ex. on/off, fanOn, FanHigh, FanMedium, FanLow, SwingOn, SwingOff, SwingTop, cool/heat) before using the DTH. There is a setup video link under the prerequisites section.

Please contact Flair support if you have any IR issues.

https://forum.flair.co/t/puck-and-mini-split-ir-setup/600/2

.................................................................................................................................

Response times may vary

.................................................................................................................................

All commands must be treated by the APIs in the cloud (SmartThings->Flair-->SmartThings), so response times may vary from few seconds to up to few tens of seconds depending on the load on the servers and any network latency involved.


.................................................................................................................................

Manual commands may cause some state desynchronization with Flair

.................................................................................................................................

The IR protocol with your unit is one-way only (Flair-->Unit). So, if you make any manual changes to your unit, the new state will not be sent back to Flair. This will probably cause some state desynchronization between Flair and your unit.


.................................................................................................................................

Structure & Room Data are cached

.................................................................................................................................

In order to avoid querying the Flair APIs for the structure & room data and for better performances, some information is locally cached in the device.

If you make changes to any room or stucture and want to update the device immediately (by default, it's done once a day at midnight), please manually press the "refresh" tile.

Troubleshooting

Here are some typical troubleshooting cases explained below. For your specific use cases, you may want to contact the author (there may be some support fees to be applied).

.................................................................................................................................

Issue #1: I don't know how to create a custom device

.................................................................................................................................

See the explanations of a fellow community member here:

http://community.smartthings.com/t/faq-an-overview-of-using-custom-code-in-smartthings/16772

or

http://thingsthataresmart.wiki/index.php?title=Using_Custom_Code

.................................................................................................................................

Issue #2: I created My Flair HVAC Unit handler and MyFlairServiceMgr in the IDE, but I don't know where to execute it

.................................................................................................................................


For the initial setup, under the ST app, click on the Marketspace? item in the bottom menu, and then, on the smartapps link and finally, MyApps (last item in the list).

If you still do not see your smartapp, please make sure that you have published it in the IDE!

For any subsequent execution, under the ST app, click on the "hamburger" menu in the upper right section and then, Smartapps. You should see the smartapp in the list.'


.................................................................................................................................

Issue #3: I executed MyFlairServiceMgr smartapp, but the 3rd page (after doing the login, and pressing Next) is blank

.................................................................................................................................

If you get a blank screen after pressing 'Next or you get the following error: " Error - bad state. Unable to complete page configuration" or any other ST errors, please check that you've enabled oAuth as specified in step 2f) in the readme.

https://github.com/yracine/device-type.myFlair/blob/master/README.md

Also, make sure that you've followed all the prerequisites:

http://thingsthataresmart.wiki/index.php?title=My_Flair_HVac_Unit#Prerequisites

Refer to MyFlairServiceMgr smartapp's installation for more details:

http://thingsthataresmart.wiki/index.php?title=MyFlairServiceMgr#Issue_.231:_I_don.27t_know_how_to_create_a_custom_smartapp

.................................................................................................................................

Issue #4: My Flair HVAC Unit is off by 'x' units with the Flair mobile app

.................................................................................................................................

First try to refresh the UI by pressing the 'refresh' tile. The ST UI does not allow automatic refresh at the moment.


.................................................................................................................................

Issue #5: I want to disable any notifications from MyFlairServiceMgr

.................................................................................................................................

Go to the smartapp's last page, and answer 'no' to the following question:

Send a push notification?"''

Be aware that you won't be notified of any connection issues.

.................................................................................................................................

Issue #6: "An unexpected error has occurred" or 'deleteObserver onError: %s' messages in MyFlairServiceMgr when I press 'Remove'

.................................................................................................................................


'Like any ST connected device, you need first to unselect all your Flair Devices from all the smartapps & routines as MyFlairServiceMgr will not uninstall w/o doing this step.

MyFlairServiceMgr is the Service Manager for all Flair Devices, so uninstalling the smartapp means that all Flair devices will be deleted.

.................................................................................................................................

Issue #7: I want to get more tracing in the IDE

.................................................................................................................................

Just update the device preferences, and edit the trace parameter, see step 7 in the readme

http://github.com/yracine/device-type.myFlair/blob/master/README.md

Do not forget to remove the trace (leave the parameter blank) after your debugging session as this setting may impact performance.


You can now set the trace level to be displayed in the device's preferences (5 is the highest level for logging):

   input("trace", "bool", title: "trace", description:
      "Set it to true to enable tracing (no spaces) or leave it empty (no tracing)")
   input("logFilter", "number",title: "(1=ERROR only,2=<1+WARNING>,3=<2+INFO>,4=<3+DEBUG>,5=<4+TRACE>)",  range: "1..5",
      description: "optional" )        


Under the IDE,to activate live logging, just click on the link below (or the variant according to your shard).


https://graph.api.smartthings.com/ide/logs

You can also edit the device's preferences under the ST mobile app by clicking on its 'gear' button.


Note: To filter the logs for a given device or smartapp, you need to click on its name in the upper section of live logging. This filtering should be done before submitting any logs for analysis.



.................................................................................................................................

Issue #8: I want to upgrade the code but I don't know how.

.................................................................................................................................

Most of the time (unless specified otherwise), you just need to copy and paste the My HVACUnit device's code from the the related txt files, and save & publish.

The same approach should be used for the smartapps.

For more details, please follow the instructions provided at:

http://github.com/yracine/device-type.myFlair/blob/master/README.md


.................................................................................................................................

Issue #9: java.util.concurrent.TimeoutException: Execution time exceeded 'x' app execution seconds

.................................................................................................................................

ST has introduced some generic rate limiting rules for all smartapps and device handlers.

For cloud-to-cloud integration, these rate limiting constraints are sometimes too low (due to network latency, servers involved, etc.), and this exception can be raised from time to time. There are some threads about it in the ST community forum:

http://community.smartthings.com/t/rate-limiting-too-restrictive-max-execution-time-exceptions/17985

http://community.smartthings.com/t/execution-times-increasing/19979

http://community.smartthings.com/t/unschedule-api-execution-time-too-long/11232


................................................................................................................................

Issue #10: com.datastax.driver.core.exceptions.ReadTimeoutException

.................................................................................................................................

These exceptions are thrown by the ST backend from time to time. I've been told that ST is working on it. This is not a specific issue with my code.

https://community.smartthings.com/t/cassandra-timeout-during-read-query/46227/3

...............................................................................................................................

Issue #11: I want to change all scales to the metric system.

.................................................................................................................................


The temperature scale needs to be changed for your ST account under the ST Mobile app, so that all your ST devices will be in the metric system.

Press the "hamburger" menu (upper left), and then the "gear" icon. You'll find the option to change the temperature scale there and press "save".

At the next "refresh", My Flair HVAC Unit will display the values in the metric system.

................................................................................................................................

Issue #12: I cannot create any objects under the new Samsung app

.................................................................................................................................


No custom DTHs can be created under the new Samsung app for the moment as indicated in the prerequisites. You'd need to use the ST classic app to execute MyFlairServiceMgr in order to initially create the Flair devices. After creating the devices, follow the steps indicated in the installation pdf file included in the zip to force a refresh of the cache in order to make them appear correctly in the new Samsung app.


...............................................................................................................................

Issue #13: Some of my devices under the new Samsung app are disconnected

.................................................................................................................................


If some of your Flair devices are disconnected under the new Samsung app, you may have created many of the same devices by executing MyFlairServiceMgr too many times... Under the new Samsung mobile app, you then need to clean them up by pressing the "edit" button next to your location and removing them.

For further execution of the MyFlairServiceMgr smartapp, refer to issue #2 http://thingsthataresmart.wiki/index.php?title=My_Flair_HVac_Unit#Issue_.233:_I_executed_MyFlairServiceMgr_smartapp.2C_but_the_3rd_page_.28after_doing_the_login.2C_and_pressing_Next.29_is_blank