My Puck device

The Unofficial SmartThings Blog
Jump to navigation Jump to search


White Puck Floating-800x800.png

Brand:Flair

Models:Puck Device

Type: 'Smart climate-control in every room.

Protocol: Wi-Fi to the puck gateway, proprietary 915Mhz protocol to the other Flair devices at your home'

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


With the puck device, you can control all Flair devices avaiable. See other Flair devices here:


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

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

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



Contents

Contribution fee is required

The Flair devices have required hundreds of hours of development & testing efforts to build, so a mandatory contribution fee 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 device operational & connected to Flair via the internet.
  • Flair Setup completed: basic information about your home & rooms entered via the Flair Mobile App or the Flair portal
   setup video here: https://www.youtube.com/watch?v=fVFgAmnRSuI 
  • Your automation hub fully operational
  • Manual mode enabled in the flair app (as you're letting your hub control the flair device(s), not Flair)

Article(s) in the media

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

Information

  • Functionality:Works with Central Systems, Window ACs, Mini Splits—and more. The Puck wireless thermostat automatically adjusts room temperature, observes and keeps track of room conditions, and turns off when you leave. Features easy-to-use controls on our iOS, Android, and web app.
  • Support of US and metric scale systems (Celsius, Fahrenheit, etc)


Here is a list of Capabilities

   capability "Relative Humidity Measurement"
   capability "Temperature Measurement"
   capability "Polling"
   capability "Refresh"
   capability "Sensor"
   capability "Battery" // to be added later
   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 "levelUp"
   command "levelDown"
   command "getPuckInfo"
   command "getPuckReadings"
   command "getPuckStates"
   command "getPressure"
   command "getBattery"
   command "getTemperature"
   command "getHumidity"
   command "setPuck"			
   command "setDesiredTemp"
   command "setPuckScale"
   command "setPuckText"
   command "setPuckImage"
   command "setPuckInactive"			
   command "setPuckHumidityOffset"
   command "setPuckTempOffset"
   command "getStructure"        
   command "setStructure"        
   command "setStructureHomeAwayMode"
   command "setStructureSetpointMode"
   command "setStructureAwayMode"
   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"
       
   command "homeAwayAutoHome"
   command "homeAwayThirdPartyHome"
   command "awaySmartAway"
   command "awayDeferToRooms"
   command "awayOffOnly"
   command "setpointEvennessActive"
   command "setpointEvenness"
   command "setpointDeferToRooms"
   command "autoMode"
   command "manualMode"
   command "produceSummaryReport"


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

   attribute "structureId"
   attribute "puckId"
   attribute "puckName"
   attribute "puckNumber"
   attribute "puckTemperature"
   attribute "puckTemperatureDisplay"
   attribute "reportingInterval"
   attribute "temperatureDisplay"
   attribute "pressure"
   attribute "orientation"
   attribute "inactive"      
   attribute "humidityOffset"        
   attribute "tempOffset"        
   attribute "puckText"
   attribute "puckimage"
   attribute "irSetup"
   attribute "irSetupEnabled"
   attribute "irDispatch"
   attribute "irDownload"
   attribute "firmwareW"
   attribute "firmwareB" 
   attribute "firmwareS" 
   attribute "light"        
   attribute "isGateway"
   attribute "puckList"    
   attribute "puckColor"    
   attribute "puckScale"    
   attribute "desiredTemperature"
   attribute "dieTemperature"
   attribute "desiredTemperatureDisplay"
   attribute "bluetoothTxPowerMw"
   attribute "beaconIntervalMs"
   attribute "dropRate" 
   attribute "systemVoltage" 
   attribute "subGhzRadioTxPowerMw"
   attribute "messageVersion"
   attribute "rotaryEncodedClicks"
   attribute "buttonPushes"        
   attribute "createdAt"
   attribute "updatedAt"
   attribute "changeSet"
   attribute "puckData"       
   attribute "puckStatesData"       
   attribute "verboseTrace"

List of Structure's Attributes available in My Puck Device

   attribute "stName"                
   attribute "stCity"                
   attribute "stState"                
   attribute "stZipCode"                
   attribute "stReportingGateway"                
   attribute "stActive"                
   attribute "stLongitude"                
   attribute "stLatitude"                
   attribute "stSetupComplete" 
   attribute "stHome"                
   attribute "stHomeAwayMode"
   attribute "stAwayMode"                
   attribute "stSPointMode"                
   attribute "stLocation"                
   attribute "stLocationType"                

List of Room's Attributes available in My Puck Device

   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 Puck Device

   attribute "zoneList"
   attribute "zoneData"

Look & Feel

Hubitat


HubitatPuck.PNG

In the new Samsung connect app

MyPuckDevice Custom p1.jpg MyPuckDevice Custom p2.jpg

In the old SmartThings' mobile app

MyPuckDeviceP1.png MyPuckDeviceP2.png MyPuckDeviceP3.png


UI Fields

Upper section of the multi-tile

  • Current indoor temperature (in Celsius or Farenheit) as shown within the circle
  • Current indoor Relative Humidity value (secondary key in multi-tile)

Lower section of the multi-tile

  • Name of the puck device
  • Num (ID) of the device
  • Gateway (true or false)
  • Inactive (true or false)
  • Battery (calculated %, to be replaced later by real value from APIs)
  • Desired Temperature (in Farenheit or Celsius according to ST account settings)
  • Up and Down arrow to set desired temperature (press to change the desired temperature)
  • Home settings (press to change to Autohome or 3rd party)
  • Away settings (press to change to Smart Away, DeferToRoom, AwayOffOnly)
  • Setpoint settings (press to change to Eveness, EvenessActive, DeferToRooms)
  • IRSetup (true or false)
  • Drop Rate
  • Refresh Button (press to get the latest values)
  • Current Temperature Offset
  • Current Humidity Offset
  • Pressure in Pa (Pascal units)
  • Room where the puck Device is located
  • Zone names associated to the Puck
  • Google Graph that represents the PuckTemperature, RoomTemperature, RoomDesiredTemperature,RoomSetpoint,PuckHumidity 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

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

UI elements are partially compatible with new STSC (Samsung) new app

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

Use of the SmartThings classic mobile app is required: all custom DTHs & smartapps above are partially compatible with the new Samsung Connect mobile app as ST is working on the required migration steps and UI tiles. However, you can create the devices in the ST classic mobile app, and use them in the new Samsung connect app.

Some UI elements not totally compatible are the scale (appearing sometimes in Celsius unless you change the setpoints), thermostat icon, and status that seems to be checking constantly as it's a cloud-to-cloud integration, etc.


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

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).

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

Battery Usage is calculated, need to be replaced by value from Flair APIs

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

The Flair APIs don't provide any information on the battery level, just the system voltage. The battery level is then grossly calculated. You should not rely on the battery usage provided.


Please contact the Flair support if you want better battery usage values.

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

Temperature and Humidity offsets are not always applied correctly

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

The ST-Flair integration code is sending the right offset to the Flair APIs, but it seems that in some cases, the offsets are not always applied correctly.

The offset are useful to correct the ambient temperature or humidity collected by the puck....

The temperature observed is often too high and seems to spike from time to time.

https://forum.flair.co/t/puck-temp-spikes/669

Please contact the Flair support if you have any similar issues.


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

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.

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

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

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


Hubitat

Copy the code from the text files under apps in the Hubitat IDE, and then press "Save".

CaptureHubitatDriver.PNG


SmartThings

See the explanations of a fellow community member here:

http://community.smartthings.com/t/faq-an-overview-of-using-custom-code-in-smartthings/16772 http://thingsthataresmart.wiki/index.php?title=Using_Custom_Code


Please refer to the installation readme (prerequisites) to find out what is the right shard for the procedure.

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

Issue #2: I created the Puck device 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 subs?equent execution, under the ST app, click on the "hamburger" menu in the upper rigth 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 prerequisites:

http://thingsthataresmart.wiki/index.php?title=My_Puck_device#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 Puck device is off by 'x' units with the Flair mobile app

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

First try to refresh the UI by pressing the 'refresh' tile. The 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 connected device, you need first to unselect all your Flair Devices from all the smartapps, automations & 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

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

big>Hubitat

a) Click on the device that you just created

http://192.168.xx.xx/device/edit/"device number" (Device number can vary from one location to the next)

b) Edit the preferences in the middle section of the screen)

You only need to edit the following parameters

(a) <trace> when needed, set to true to get more tracing (no spaces)

(b) <logFilter:1..5> Values=[Level 1=ERROR only,2=<Level 1+WARNING>,3=<2+INFO>,4=<3+DEBUG>,5=<4+TRACE>]

c) Save the preferences by clicking on the corresponding button.

N.B. The logs are available under the IDE at:

http://192.168.xx.xx/logs (insert your own hub's IP address)

You can click at the top of the window on the device name to filter the logs.

SmartThings

a) Go to https://graph.api.smartthings.com/device/list (or whatever your shard is and click on My Devices in the IDE's top menu)

b) Click on the device that you just created

c) Click on Preferences (edit)

You only need to edit the following parameters

(a) <trace> when needed, set to true to get more tracing (no spaces) (b) <logFilter:1..5> Values=[Level 1=ERROR only,2=<Level 1+WARNING>,3=<2+INFO>,4=<3+DEBUG>,5=<4+TRACE>]


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

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 Puck 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 account, so that all your 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 Puck Device will display the values in the metric system.

P.S. If you use the new Samsung app, you may have to press refresh tile and the up and down arrows in the ST classic app to force a refresh of the values under the new Samsung app as the app has a different cache than the ST classic app.


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

Issue #12: 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 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_Puck_device#Issue_.232:_I_created_the_Puck_device_handler_and_MyFlairServiceMgr_in_the_IDE.2C_but_I_don.27t_know_where_to_execute_it