Exception in MakerAPI

I've used MakerAPI a great deal but now I'm trying to control Flair Vents/Pucks with it through the driver written by @yracine66. When I try to send an http command to the Maker API for a Flair Puck I am getting an exception.

The Flair devices show up properly in the list of devices on the MakerAPI app page and after selecting them and hitting the Get Devices link they show up properly in the returned JSON. Here is the relevant portion of that JSON:

{
"id":"625",
"name":"My Puck Device",
"label":"My Puck Guest Room-1656",
"type":"My Puck Device",
"room":null
},
{
"id":"626",
"name":"My Puck Device",
"label":"My Puck Exercise Room-88a7",
"type":"My Puck Device",
"room":null
},
{
"id":"627",
"name":"My Flair Vent",
"label":"My Flair Vent Guest Room-574a",
"type":"My Flair Vent",
"room":null
},
{
"id":"628",
"name":"My Flair Vent",
"label":"My Flair Vent Exercise Room-46f6",
"type":"My Flair Vent",
"room":null
},

I am sending the following command where the MakerAPI App ID is 37 and the IP address of my Hubitat Elevation hub is 10.10.0.54:

http://10.10.0.54/apps/api/37/devices/626/refresh?access_token=XXXXXXXXX

I get the following response:

{"error":true,"type":"java.lang.Exception","message":"An unexpected error occurred."}

Looking at the Hubitat log when I send the command I get the following: app:372023-04-18 11:02:05.710 AMerrorjava.lang.NumberFormatException: Character is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 742 (method sendDeviceCommand)

I have tried this for several other commands and get the same results.

I'm told by @yracine66 that since the error is internal to the MakerAPI there is nothing he can do to address it. So, anything anyone can offer to address the problem would be greatly appreciated.

Thanks in advance for the help

So, without the source code to the driver in question (i.e. I believe @yracine66's code is closed source), I am not sure the community is going to be able to assist all that much.

Can you create a Open Source driver that exhibits the exact same behavior when trying to call the "refresh" command on the device via the MakerAPI app?

If the problem can be reproduced by others, then it can be solved. If the issue is somehow limited to @yracine66's closed source code, he will need to address it.

2 Likes

This error is generated by MakerAPI because the device (and ergo it's driver) is returning a character that MakerAPI cannot decode.

1 Like

Hi, the problem is linked to the Maker API which is a closed source code (to my knowledge).

The error message below is thrown by the Maker API, in the sendDeviceCommand(), not in my code:

java.lang.NumberFormatException: Character is neither a decimal digit number, decimal point, nor "e" notation exponential mark. on line 742 (method sendDeviceCommand).

What's the Maker API doing at line 742?

Maybe @mike.maxwell can help. What are the invalid characters that the Maker API cannot process in its json payload?

Regards

Yes, I understand that.

My original question still stands...

1 Like

Can you post a screen shot of current device states for one of the vents?
Also it goes without saying that the device operates correctly from the device details page in hubitat right?

2 Likes

The commands work properly from the device details page. Here is what is shown in the current states column on the device details page. I put XXXs through a few entries that might have had values that shouldn't be publicly displayed

Current States

  • checkInterval : 3600
  • createdAt : 2023-04-17 16:42:23 MDT
  • firmwareS : 159
  • level : 100
  • lightPattern : 1
  • motorRunTime : 1127
  • pressure : 81957
  • rmActive : true
  • rmAirReturn : false
  • rmAwayMode : Smart Away
  • rmCurrentTemperature : 67.2
  • rmFrozenPipePetProtect : true
  • rmHoldReason : Set by Jay
  • rmHoldUntil : 2023-04-18 13:36:17
  • rmHumidityAwayMax : 80
  • rmHumidityAwayMin : 10
  • rmOccupancyMode : Flair Auto
  • rmPreheatPrecool : true
  • rmPucksInactive : active
  • rmSetpoint : 69.0
  • rmTempAwayMax : 72.5
  • rmTempAwayMin : 60.8
  • roomId : 107221
  • roomName : Exercise Room
  • rssi : -62
  • structureId : 52289
  • switch : on
  • systemVoltage : 3.29
  • temperature : 75.6
  • temperatureDisplay : 76
  • updatedAt : 2023-04-18 19:32:28 MDT
  • ventId : XXXXX
  • ventList : XXXXX,
  • ventName : Exercise Room-46f6
  • verboseTrace : doRequest>exception java.lang.ClassCastException for https://api.flair.co/api/vents/XXXXXXX/current-reading
  • zoneList : XXXXX,
  • zoneName : Crestron Thermostat
  • ventData : null
  • sensorReadingsData : null
  • battery : 100

When I was posting this I notices that zoneList and ventList both include a trailing comma. Not sure if that could be the issue

Thanks for everyone's help

Hi @mike.maxwell,

Those are the fields that need to be returned in json to the caller by the Maker API:
Somehow, in this list of fields, the Maker APIs is throwing an exception when formatting
the json payload:

  • battery : 0
  • beaconIntervalMs : 4095
  • bluetoothTxPowerMw : 500
  • buttonPushes : 22528
  • checkInterval : 3600
  • createdAt : 2017-08-14 18:30:33 EDT
  • desiredTemperature : 0.0
  • desiredTemperatureDisplay : 0.0
  • dieTemperature : 3985.0
  • dropRate : 0
  • firmwareB : 0
  • firmwareS : 159
  • firmwareW : 152
  • humidity : 46
  • humidityOffset : 0
  • inactive : false
  • irDownload : false
  • isGateway : true
  • light : 3
  • messageVersion : 0
  • orientation : standing
  • pressure : 0
  • puckColor : white
  • puckId : 29089a84-f594-5441-15c5-0ced94976XXX
  • puckList : 29089a84-f594-5441-15c5-0ced94976XXX,
  • puckName : Office-2908
  • puckNumber : 2908
  • puckScale : C
  • puckTemperature : 20.7
  • puckTemperatureDisplay : 20.7
  • reportingInterval : 255
  • rmActive : true
  • rmAirReturn : false
  • rmAwayMode : Smart Away
  • rmCurrentTemperature : 20.7
  • rmFrozenPipePetProtect : false
  • rmHoldReason : hold-reason
  • rmHoldUntil : 2023-04-18 22:31:56 EDT
  • rmHumidityAwayMax : 80
  • rmHumidityAwayMin : 10
  • rmOccupancyMode : Flair Auto
  • rmPreheatPrecool : true
  • rmPucksInactive : active
  • rmSetpoint : 21.5
  • rmTempAwayMax : 22.5
  • rmTempAwayMin : 16.0
  • rmUserDesiredTemperature : 0.0
  • roomId : 1093
  • roomName : Office
  • rotaryEncodedClicks : 0
  • stActive : true
  • stAwayMode : SmartAway
  • stHeatCoolMode : auto
  • stHome : true
  • stHomeAwayMode : Autohome
  • stMode : manual
  • stName : 95 Rose
  • stReportingGateway : true
  • stSPointMode : DeferRooms
  • stSetupComplete : true
  • structureId : 63
  • systemVoltage : 3.41
  • tempOffset : 0
  • temperature : 23.1
  • temperatureDisplay : 0.0
  • updatedAt : 2023-04-18 19:41:04 EDT
  • verboseTrace : doRequest>done with get
  • zoneList : 215,
  • zoneName : Artic King
  • thermostatSetpoint : 0.0
  • rmCurrentTemperatureDisplay : 20.7

Seems likely at first glance ....

what's this about:
doRequest>exception java.lang.ClassCastException for https://api.flair.co/api/vents/XXXXXXX/current-reading

It doesn't look like the driver is running clean...

@jbasen Did you modify the driver as this error doesn't appear under my hub?

@mike.maxwell It's not zoneList, puckList or the dates as I've tried to remove the fields and I've still had the exception.

I really don't know why the fields are not parsed correctly.

Regards,

What happens if you remove verboseTrace? Could it be the ">" that's causing the issue?

It works for other drivers like MyEcobee device which has way more fields and include verboseTrace.

@yracine66 - I have not modified the driver in any way. I have just pasted the code you provided into the driver editor window in HE and hit save

Thanks

@jbasen It seems that you called the driver with some bad parameters hence the Class cast exception.

Does the verboseTrace field in your other drivers include >, which is commonly used as a character indicating redirect.

@yracine66 - I may have done something earlier when testing that included passing a parameter but sending the refresh command as shown in url to the MakerAPI doesn't include any parameters and always causes the Number format exception. Thanks

I've removed the character ('>') and replaced it with ':', still the same error.

P.S. MyEcobee device works and it has the same character in verboseTrace.

Thnx for your suggestion, but it's not this character.

1 Like

@mike.maxwell please let me know if you need to access my hub for debugging / testing purposes. My goal is to simply find a solution to this problem; wherever it lies. I'm available during the day on Wednesday and Friday this week if the process requires my assistance. Thanks

1 Like

Agreed.

It would easiest if @ogiewon’s suggestion was followed up; i.e. someone create a β€œmini” open-source driver that recapitulates this specific issue.

1 Like