tomas-kulhanek / homebridge-fenix-tft-wifi

Homebridge plugin for Fenix TFT WiFi thermostats
Apache License 2.0
0 stars 0 forks source link

Thermostat status not updated in HomeKit/Homebridge #2

Closed falinka closed 1 year ago

falinka commented 1 year ago

Thermostat status is not updated when being modified via app or from the thermostat itself. Changing it on/off or changing mode has no impact on how it's displayed in Homebridge.

  1. Change heating mode via thermostat or via Fenix app
  2. Open home bridge, check values.

Expected behavior:

When you change values from thermostat/app, expectation is that those values would be changed as well in homebridge.

Logs:

No logs are present regarding any actions/sync in homebridge Plugin Config:

{ "accessToken": xxx, "refreshToken": "xxx", "temperatureCheckInterval": 30, "temperatureUnit": 0, "platform": "FenixTFTWifi", "_bridge": { "username": "xxx", "port": xxx }

Screenshots: Screenshot from application: image

Actual case in homebridge:

image

Environment:

  1. Turn off thermostat
tomas-kulhanek commented 1 year ago

@falinka I know about the thermostat shutdown situation and I am trying to solve it. Hombridge does not respond to switching off and on at this time. However, as soon as you turn off the thermostat through the Fenix application, the status will be reflected according to the information below.

As for the update, it takes place once every 30 minutes. If necessary, this interval can be changed using "temperatureCheckInterval".

I will look at the functionality and adjust it in the next version.

tomas-kulhanek commented 1 year ago

@falinka you can try to update on 1.2.0 and modify temperateCheckInterval

falinka commented 1 year ago

Hi Tomas,

Updated to v1.2.0, interval changed to 1 minute. Still, it behaves the same. In application, all thermostats are off, but in homebridge only few are displayed as off. I could do another screenshot, but nothing has changed since last time - first screenshot is from Fenix app, second from homebridge. As you can see, all are off inside Fenix, while in HB only few.

I enabled debug, but not much is changing:

[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Bathroom
[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Storage
[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Office
[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Bed room
[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Toilet
[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Playroom
[4/19/2023, 8:59:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Hallway
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Bathroom
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Storage
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Office
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Bed room
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Toilet
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Playroom
[4/19/2023, 9:00:33 PM] [homebridge-fenix-tft-wifi] Update Fenix TFT accessory Hallway

I'm open to any tests you wanna do, or collect logs or whatever ;)

tomas-kulhanek commented 1 year ago

Ok, you must update on 2.0.1 and clear cache for all thermostats. Properties of all accessories are cached :(

falinka commented 1 year ago

Hi,

I did update to v2.1.0, now I get:

[4/20/2023, 9:35:12 AM] [homebridge-fenix-tft-wifi] Cannot to retrieve base data. Do you have valid token?

I downgraded to 1.2.0, and token is valid.

Update: I've upgraded to 2.0.1 - tokens are still valid. It seems that something happened between 2.0.1 & 2.1.0 that broke authentication.

tomas-kulhanek commented 1 year ago

@falinka After update this happens to me sometimes too, but that's mainly because the Fenix server responds with an error. Is it possible to deploy version 2.1.0 and restart the homebridge or plugin?

Update: and set debug please

falinka commented 1 year ago

So,

Updated to v2.1.0 - immediately I got the token error. Then, I removed cashed accessories, restarted entire homebridge. Same thing, token issue.

Here is debug log, though not much there:


[4/20/2023, 12:04:47 PM] [Homebridge UI] Sending SIGKILL to Homebridge
[4/20/2023, 12:04:47 PM] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGKILL
[4/20/2023, 12:04:52 PM] [HB Supervisor] Restarting Homebridge...
[4/20/2023, 12:04:52 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -D
[4/20/2023, 12:04:52 PM] [HB Supervisor] Started Homebridge v1.6.0 with PID: 29213
[4/20/2023, 12:04:54 PM] Loaded config.json with 0 accessories and 7 platforms.
[4/20/2023, 12:04:54 PM] Loaded 5 cached accessories from cachedAccessories.
[4/20/2023, 12:04:54 PM] ---
[4/20/2023, 12:04:56 PM] Plugin /usr/lib/node_modules/homebridge-config-ui package.json does not contain the keyword 'homebridge-plugin'.
[4/20/2023, 12:04:56 PM] Loaded plugin: homebridge-config-ui-x@4.50.2
[4/20/2023, 12:04:56 PM] Registering platform 'homebridge-config-ui-x.config'
[4/20/2023, 12:04:56 PM] ---
[4/20/2023, 12:04:56 PM] Loaded plugin: homebridge-fenix-tft-wifi@2.1.0
[4/20/2023, 12:04:56 PM] Registering platform 'homebridge-fenix-tft-wifi.FenixTFTWifi'
[4/20/2023, 12:04:56 PM] ---
[4/20/2023, 12:04:57 PM] Loaded plugin: homebridge-govee@8.1.2
[4/20/2023, 12:04:57 PM] Registering platform 'homebridge-govee.Govee'
[4/20/2023, 12:04:57 PM] ---
[4/20/2023, 12:04:57 PM] Loaded plugin: homebridge-homeconnect@0.29.0
[4/20/2023, 12:04:57 PM] Registering platform 'homebridge-homeconnect.HomeConnect'
[4/20/2023, 12:04:57 PM] ---
[4/20/2023, 12:04:57 PM] Loaded plugin: homebridge-lg-thinq@1.4.1
[4/20/2023, 12:04:57 PM] Registering platform 'homebridge-lg-thinq.LGThinQ'
[4/20/2023, 12:04:57 PM] ---
[4/20/2023, 12:04:58 PM] Disabled plugin: homebridge-meross@9.0.3
[4/20/2023, 12:04:58 PM] ---
[4/20/2023, 12:04:58 PM] Loaded plugin: homebridge-webos-tv@2.4.1
[4/20/2023, 12:04:58 PM] Registering platform 'homebridge-webos-tv.webostv'
[4/20/2023, 12:04:58 PM] ---
[4/20/2023, 12:04:58 PM] Loading 7 platforms...
[4/20/2023, 12:04:58 PM] [HomeConnect] Initializing HomeConnect platform...
[4/20/2023, 12:04:58 PM] [HomeConnect] new HomeConnectPlatform
[4/20/2023, 12:04:58 PM] [HomeConnect] homebridge-homeconnect version 0.29.0
[4/20/2023, 12:04:58 PM] [HomeConnect] Node.js version 18.16.0 (satisfies >=20.0.0 || ^18.12.1 || ^16.18.1 || ^14.21.2)
[4/20/2023, 12:04:58 PM] [HomeConnect] Homebridge version 1.6.0 (satisfies >=1.4.0)
[4/20/2023, 12:04:58 PM] [HomeConnect] Homebridge API version 2.7 (satisfies ^2.7)
[4/20/2023, 12:04:58 PM] [HomeConnect] Homebridge HAP version 0.11.0 (satisfies >=0.9.0)
[4/20/2023, 12:04:58 PM] [LGThinQ] Initializing LGThinQ platform...
[4/20/2023, 12:04:58 PM] [webostv] Initializing webostv platform...
[4/20/2023, 12:04:58 PM] Ignoring config for the platform "Meross" in your config.json as the plugin "homebridge-meross" has been disabled.
[4/20/2023, 12:04:58 PM] [Govee] Initializing Govee platform...
[4/20/2023, 12:04:58 PM] [Govee] Initialising plugin v8.1.2 | System linux | Node v18.16.0 | HB v1.6.0 | HAPNodeJS v0.11.0...
[4/20/2023, 12:04:58 PM] [FenixTFTWifi] Initializing FenixTFTWifi platform...
[4/20/2023, 12:04:58 PM] [FenixTFTWifi] Initializing child bridge 0E:5C:7A:B3:1B:B6
[4/20/2023, 12:04:58 PM] [LGThinQ] Loading accessory from Homebridge cache: Washer
[4/20/2023, 12:04:58 PM] [LGThinQ] Loading accessory from Homebridge cache: Dryer
[4/20/2023, 12:04:58 PM] [LGThinQ] Loading accessory from Homebridge cache: Refrigerator
[4/20/2023, 12:04:58 PM] [HomeConnect] Restored 1 cached accessories
[4/20/2023, 12:04:58 PM] [LGThinQ] Executed didFinishLaunching callback
[4/20/2023, 12:04:58 PM] [webostv] Init - initializing devices
[4/20/2023, 12:04:58 PM] [webostv] [LG TV] Init - got TV configuration, initializing device with name: LG TV
[4/20/2023, 12:04:58 PM] [Govee] Plugin initialised. Setting up accessories....
[4/20/2023, 12:04:58 PM] Publishing external accessory (name: LG TV, publishInfo: {
  username: '44:9D:CD:E3:DF:B7',
  pincode: '***-**-***',
  category: 31,
  port: undefined,
  bind: [ 'eth0', [length]: 1 ],
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'ciao'
}).
[4/20/2023, 12:04:58 PM] Publishing bridge accessory (name: Homebridge, publishInfo: {
  username: '0E:C5:14:72:19:D5',
  port: 51669,
  pincode: '***-**-***',
  category: 2,
  bind: [ 'eth0', [length]: 1 ],
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'ciao'
}).
Setup Payload:
X-HM://0024IIT7F2FB5
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 631-37-371 │     
    └────────────┘     

[4/20/2023, 12:04:58 PM] LG TV BD70 is running on port 43291.
[4/20/2023, 12:04:58 PM] Please add [LG TV BD70] manually in Home app. Setup Code: 631-37-371
[4/20/2023, 12:04:58 PM] Homebridge v1.6.0 (HAP v0.11.0) (Homebridge) is running on port 51669.
[4/20/2023, 12:04:58 PM] [webostv] [LG TV] Connecting to TV
[4/20/2023, 12:04:58 PM] [HomeConnect] Attempting authorisation
[4/20/2023, 12:04:58 PM] [Govee] [LAN] disabling client as disabled in config.
[4/20/2023, 12:04:58 PM] [HomeConnect] Using saved access token
[4/20/2023, 12:04:58 PM] [HomeConnect] Successfully authorised
[4/20/2023, 12:04:58 PM] [HomeConnect] Home Connect request #1: GET /api/homeappliances
[4/20/2023, 12:04:59 PM] [HomeConnect] Scheduling configuration schema write
[4/20/2023, 12:04:59 PM] [HomeConnect] Home Connect request #1: 200 OK +386ms
[4/20/2023, 12:04:59 PM] [HomeConnect] Found 1 appliances
[4/20/2023, 12:04:59 PM] [HomeConnect] Connecting accessory 'Dishwasher'
[4/20/2023, 12:04:59 PM] [HomeConnect] Starting events stream for all appliances
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Bosch Dishwasher (xxx)
[4/20/2023, 12:04:59 PM] [HomeConnect] Home Connect request #2: GET /api/homeappliances/events
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Connected, so reading appliance state...
[4/20/2023, 12:04:59 PM] [HomeConnect] Home Connect request #3: GET /api/homeappliances/010100518398001687
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Cache loaded (19 entries)
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Cache "Appliance power" [en-GB, updated 20 hours 48 minutes ago]
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Cache "Appliance commands" [en-GB, updated 20 hours 48 minutes ago]
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Cache "Appliance settings" [en-GB, updated 20 hours 48 minutes ago]
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Cache "Appliance settings" [en-GB, updated 20 hours 48 minutes ago]
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Restored details of 7 programs
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Can be switched off
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Does not support Functional Light
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Does not support a child lock
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Cache "Appliance settings" [en-GB, updated 20 hours 48 minutes ago]
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Does not support Ambient Light
[4/20/2023, 12:04:59 PM] [LGThinQ] [request] get https://route.lgthinq.com:46030/v1/service/application/gateway-uri
[4/20/2023, 12:04:59 PM] [HomeConnect] Home Connect request #2: 200 OK +167ms
[4/20/2023, 12:04:59 PM] [HomeConnect] Started events stream for all appliances after 319 milliseconds
[4/20/2023, 12:04:59 PM] [Govee] [HTTP] client enabled and found 1 device(s).
[4/20/2023, 12:04:59 PM] [HomeConnect] Home Connect request #4: 200 OK +151ms
[4/20/2023, 12:04:59 PM] [HomeConnect] [Dishwasher] Inactive (Inactive)
[4/20/2023, 12:04:59 PM] [Govee] [AWS] client enabled.
[4/20/2023, 12:04:59 PM] [Govee] [BLE] disabling client as disabled in config.
[4/20/2023, 12:05:00 PM] [homebridge-fenix-tft-wifi] Launched child bridge with PID 29247
[4/20/2023, 12:05:00 PM] Registering platform 'homebridge-fenix-tft-wifi.FenixTFTWifi'
[4/20/2023, 12:05:00 PM] [homebridge-fenix-tft-wifi] Loaded homebridge-fenix-tft-wifi v2.1.0 child bridge successfully
[4/20/2023, 12:05:00 PM] Loaded 0 cached accessories from cachedAccessories.0E5C7AB31BB6.
[4/20/2023, 12:05:00 PM] [homebridge-fenix-tft-wifi] Finished initializing platform: undefined
[4/20/2023, 12:05:00 PM] Publishing bridge accessory (name: homebridge-fenix-tft-wifi, publishInfo: {
  username: '0E:5C:7A:B3:1B:B6',
  port: 52475,
  pincode: '***-**-***',
  category: 2,
  bind: [ 'eth0', [length]: 1 ],
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'ciao'
}).
[4/20/2023, 12:05:00 PM] [homebridge-fenix-tft-wifi] Executed didFinishLaunching callback
[4/20/2023, 12:05:00 PM] Homebridge v1.6.0 (HAP v0.11.0) (homebridge-fenix-tft-wifi) is running on port 52475.
[4/20/2023, 12:05:00 PM] [homebridge-fenix-tft-wifi] Loading tokens from custom config
[4/20/2023, 12:05:00 PM] [homebridge-fenix-tft-wifi] Check tokens from custom config
[4/20/2023, 12:05:00 PM] [Govee] ✓ Setup complete. This plugin has been made with ♥ by bwp91, please consider a ☆ on GitHub if you are finding it useful!
[4/20/2023, 12:05:02 PM] [HomeConnect] Scheduled configuration schema write complete
[4/20/2023, 12:05:06 PM] [homebridge-fenix-tft-wifi] Cannot to retrieve base data. Do you have valid token?```
tomas-kulhanek commented 1 year ago

@falinka v2.1.0 have another storage for new access token. Could you check .fenixTftWifi.config.json file in the homebridge folder? The file contains json, where the new access and refresh token are stored. It is quite possible that you have an invalid one stored there. If it doesn't match the one you have in the plugin settings, just delete the file.

Fenix has a token validity of only 24h, therefore the renewal takes place there and the new one is saved in this file.

Data from the access token can be analyzed using https://jwt.io/ where there is also information about the expiration as a timestamp.

falinka commented 1 year ago

You are correct. .fenixTftWifi.config.json contained the old token, thus it wasn't really working. Authentication is now back to normal. Original problem still persists though :)

tomas-kulhanek commented 1 year ago

what? Do you have any debug log from v2.1.0?

I tried it again on my home homebridge and it responded to both shutdown and cooling.

falinka commented 1 year ago

Yes, I do. Tell me, do you want to chat somewhere, instead of ping-pong here?

falinka commented 1 year ago

Update:

I removed all the settings regarding this plugin, recreated everything, and it seems to be better now. Changing modes from HK/HB works, and these actions are reflected on the thermostat and in Fenix app. I will continue to monitor and test various scenarios, and if something, I'll let you know.

Thanks for the updates :)

tomas-kulhanek commented 1 year ago

Great news! Have you also tried wiping the accessories cache?

If necessary, I can be found, for example, on Discord Hombridge as TomášKulhánek#1148

falinka commented 1 year ago

Yeap, I did clean cached accessories, cleaned up all the settings, and did almost fresh start, and so far, still looking good :) I'll let you rest a bit, before I submit something else :)