RobertD502 / home-assistant-flair

Custom component for Home Assistant Core for Flair pucks, vents, rooms, structures, and minisplits
MIT License
87 stars 12 forks source link

Occasional error #69

Closed jckickflip closed 6 months ago

jckickflip commented 6 months ago

I have the thermostats changed based home away or night and get this error 50% of the time

Stopped because an error was encountered at December 24, 2023 at 9:40:20 AM (runtime: 8.08 seconds)

Flair server response content-type is not json: Internal Server Error

Internal Server Error

It is called via 3 different scripts but the same error for all 3. One of them looks like this:

alias: Set room thermostats sequence:

RobertD502 commented 6 months ago

I'm assuming all of those climate entities correspond to Flair rooms? Also, am I right to assume that your thermostat is not directly integrated with Flair (within the Flair app)?

Based on your script, you are sending a request to change the set point for each room individually at the same time and, by the looks of it, sometimes Flair's servers fail to handle receiving that many requests for your account all at once. My suggestion:

  1. Make sure the set point controller setting is set to Flair app: you can find this setting as a select entity in the Flair Structure device within Home Assistant or within the Flair mobile app under Home Settings --> System Settings --> Set Point Controller.
  2. Change your current scripts to make the climate.set_temperature service call on the single STRUCTURE climate entity instead of each individual room climate entity. Doing so will mean you are only sending a single request to Flair's servers. By setting a temperature on the structure climate entity, Flair will change the temperature for all the Flair Rooms within this Flair Structure.
jckickflip commented 6 months ago

You are correct that each one is a room and only one room gets set different that the others at night so I will try that approach and see what happens

RobertD502 commented 6 months ago

For the night scenario, I'd call the structure climate entity and then add a delay (5 seconds or so) before calling a different temperature on the climate entity for the one room that is set differently - the structure climate entity will set all rooms to a specific temp and then the delay will give Flair time to execute the initial command before you're sending the unique temp for that one room.

jckickflip commented 6 months ago

I tried changing the structure climate temp and the main setpoint at the top of the flair app changes but the pucks temps do not. Also tried changing that main temp at the top of the flair app , pucks still did not change. I’m going to try calling each room thermostat one by one with a short delay between and see if that helps. Let me know if you have any idea why the main structure temp would not work

RobertD502 commented 6 months ago

Given that this is also happening in the Flair app, it is a bug on Flair's end. What you'll want to do is raise this issue with their support team. Word of advice: don't mention anything related to Home Assistant when discussing this issue with the customer support team- only let them know that when using the Flair app, if you change the entire structure's set point temp, the pucks don't reflect the new temp for the rooms they are associated with.

Small rant to explain my reason:

I had a user mention that when changing the set point using a puck, the associated Flair room wasn't getting changed to this new set point (in fact, the puck just reverts back to the previous set point as well). I noticed the same issue with my devices as well and this was all evident within the Flair app itself (everything from physically changing the set point temp using the puck and seeing that the room set point wasn't changed was being done outside of Home Assistant). When the user contacted Flair support they mentioned Home Assistant which allowed CS to latch on to Home Assistant and blame it as Home Assistant "not querying the API fast enough or accurately and providing stale/false data. It's not an issue with Flair's API.” All completely false since this can be debunked by the fact that the same behavior is exhibited on their own app and when all user interaction with Flair devices was carried out outside of Home Assistant (plus this integration uses the EXACT same API endpoints as their mobile apps). So, if you want to get anywhere with them, don't mention Home Assistant.

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.