Closed floriangrotz closed 2 years ago
This plugin creates a HomeKit Switch
service for all appliances/accessories, as described on https://github.com/thoukydides/homebridge-homeconnect/wiki/HomeKit-Mapping. This is used to indicate the current power state, and also somewhere to attach HomeKit characteristics to indicate other common state.
The plugin asks the Home Connect servers which power states are supported by the appliance. If the API reports that it only supports BSH.Common.EnumType.PowerState.On
(which should be the case for all Cooling appliances) then the Switch
is configured as being read-only. If the API reports that the appliance also supports either Off
or Standby
then the switch is configured as being read/write, and the plugin will attempt to set the appliance's BSH.Common.Setting.PowerState
when the state is changed in HomeKit.
The API does not provide any way to tell whether the PowerState can actually be controlled, other than to try it. In the case of Hob/Cooktop appliances, the API is supposed to be gaining the ability to control power and programs sometime during 2022. Hence, I do not want to hardcode this feature being disabled.
The FridgeFreezer appliance is more curious. As I noted above, all Cooling appliances are always On
. The plugin should be leaving the Switch
read-only. Even if HomeKit ignores that the plugin should not take any action if an attempt is made to change the state. The fact that the log shows it trying to set the PowerState
suggests that the API incorrectly reported that the appliance supported either Off
or Standby
. If that is the case then it is a Home Connect API bug, not an error in this plugin.
This is not the first time that the API has been broken and returned incorrect information about the PowerState
that can be supported. About a year ago it incorrectly returned that Oven appliances support both Off
and Standby
, whereas they only support Standby
.
The best that I can do is to report this bug to the Home Connect Developer team, but for that I will need more information.
Please:
-D
command line option), from when Homebridge is first started/restarted. There should be a line for the Fridge freezer saying Cannot be switched off
, but I suspect that it will say either Can be switched off
or Can be placed in standby
..homebridge/homebridge-homeconnect/persist
directory. (You can find a description of the files in this directory at https://github.com/thoukydides/homebridge-homeconnect/wiki/Files#plugin-persistent-cache.) Ignore the 94a08da1fecbb6e8b46990538c7b50b2
and 130b9cf2dc079eb8116e6fca2c2ec001
files. There should be an additional file corresponding to each of your appliances. Please provide copies of those per-appliance files. They just contain a cache of the responses received from the Home Connect API about the appliance capabilities; they only individual information is the haID for the appliance - which I will need to report the issue to the Home Connect Team anyway. (Do NOT post/share the 94a08da1fecbb6e8b46990538c7b50b2
file since that contains your OAuth tokens!)Fridge
[11/04/2022, 19:08:26] [HomeConnect] [Fridge freezer] SET Off
[11/04/2022, 19:08:26] [HomeConnect] Home Connect request #28: PUT https://api.home-connect.com/api/homeappliances/SIEMENS-KA92DHB31-
Hob
[11/04/2022, 19:14:07] [HomeConnect] [Hob] SET Off
[11/04/2022, 19:14:07] [HomeConnect] Home Connect request #29: PUT https://api.home-connect.com/api/homeappliances/SIEMENS-EX601JYW1E-
Fridge
/var/lib/homebridge/homebridge-homeconnect/persist $ cat 0cfbcc4089aea4cd7d8872c02e7df9be
{"key":"SIEMENS-KA92DHB31-
Hob
/var/lib/homebridge/homebridge-homeconnect/persist $ cat e7c4994e01e7602ec8b8a6b88562e33c
{"key":"SIEMENS-EX601JYW1E-
Log:
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #1: OK +518ms
[11/04/2022, 19:17:50] [HomeConnect] Found 6 appliances
[11/04/2022, 19:17:50] [HomeConnect] Scheduling configuration schema write
[11/04/2022, 19:17:50] [HomeConnect] Connecting accessory 'Hood'
[11/04/2022, 19:17:50] [HomeConnect] [Hood] Siemens Hood (E-Nr: LC98KLV60/03)
[11/04/2022, 19:17:50] [HomeConnect] Connecting accessory 'Fridge freezer'
[11/04/2022, 19:17:50] [HomeConnect] [Fridge freezer] Siemens FridgeFreezer (E-Nr: KA92DHB31/05)
[11/04/2022, 19:17:50] [HomeConnect] Connecting accessory 'Dishwasher'
[11/04/2022, 19:17:50] [HomeConnect] [Dishwasher] Siemens Dishwasher (E-Nr: SX878D26PE/66)
[11/04/2022, 19:17:50] [HomeConnect] Connecting accessory 'Hob'
[11/04/2022, 19:17:50] [HomeConnect] [Hob] Siemens Hob (E-Nr: EX601JYW1E/01)
[11/04/2022, 19:17:50] [HomeConnect] Connecting accessory 'Oven'
[11/04/2022, 19:17:50] [HomeConnect] [Oven] Siemens Oven (E-Nr: HB678GBS6/63)
[11/04/2022, 19:17:50] [HomeConnect] Connecting accessory 'Coffee Maker'
[11/04/2022, 19:17:50] [HomeConnect] [Coffee Maker] Siemens CoffeeMaker (E-Nr: TI957FX5DE/20)
[11/04/2022, 19:17:50] [HomeConnect] Starting events stream for all appliances
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #2: GET https://api.home-connect.com/api/homeappliances/events
(node:10286) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use node --trace-warnings ...
to show where the warning was created)
[11/04/2022, 19:17:50] [HomeConnect] [Hood] Connected, so reading appliance state...
[11/04/2022, 19:17:50] [HomeConnect] [Fridge freezer] Connected, so reading appliance state...
[11/04/2022, 19:17:50] [HomeConnect] [Dishwasher] Connected, so reading appliance state...
[11/04/2022, 19:17:50] [HomeConnect] [Hob] Connected, so reading appliance state...
[11/04/2022, 19:17:50] [HomeConnect] [Oven] Connected, so reading appliance state...
[11/04/2022, 19:17:50] [HomeConnect] [Coffee Maker] Connected, so reading appliance state...
11/04/2022, 19:17:50] [HomeConnect] Home Connect request #3: GET https://api.home-connect.com/api/homeappliances/SIEMENS-LC98KLV60
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #4: GET https://api.home-connect.com/api/homeappliances/SIEMENS-KA92DHB31
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #5: GET https://api.home-connect.com/api/homeappliances/SIEMENS-SX878D26PE
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #6: GET https://api.home-connect.com/api/homeappliances/SIEMENS-EX601JYW1E
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #7: GET https://api.home-connect.com/api/homeappliances/SIEMENS-HB678GBS6
[11/04/2022, 19:17:50] [HomeConnect] Home Connect request #8: GET https://api.home-connect.com/api/homeappliances/SIEMENS-TI957FX5DE
[11/04/2022, 19:17:51] [HomeConnect] Home Connect request #3: OK +311ms
[11/04/2022, 19:17:51] [HomeConnect] Home Connect request #9: GET https://api.home-connect.com/api/homeappliances/SIEMENS-LC98KLV60/status
[11/04/2022, 19:17:51] [homebridge-homeconnect] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 0 exceeded minimum of 25. See https://git.io/JtMGR for more info.
[11/04/2022, 19:17:51] [homebridge-homeconnect] Error:
at Brightness.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2142:105)
at Brightness.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2045:14)
at Brightness.
Both the Home Connect API and this plugin are behaving correctly and as intended, so I am ignoring that.
However, the API incorrectly returned that your FridgeFreezer supports being switched off:
{
"name":"Power status",
"key":"BSH.Common.Setting.PowerState",
"constraints":{
"allowedvalues":[
"BSH.Common.EnumType.PowerState.MainsOff",
"BSH.Common.EnumType.PowerState.Off",
"BSH.Common.EnumType.PowerState.On",
"BSH.Common.EnumType.PowerState.Standby"
],
"displayvalues":[
"Off",
"Off",
"On",
"Standby"
],
"default":"BSH.Common.EnumType.PowerState.On",
"access":"read"
},
"type":"BSH.Common.EnumType.PowerState",
"displayvalue":"On",
"value":"BSH.Common.EnumType.PowerState.On"
}
This will need to be fixed by the Home Connect team. They will require the haID of your appliance to investigate, but you appear to have deleted that from the information you provided.
Please either provide the haID for me to report the issue, or report it yourself.
Include the HAids
@thoukydides - can I help there with something or do you know any of the HC Devs?
I have reported the FridgeFreezer bug to the Home Connect team. If there is any feedback I will post it here, but most likely this will just be quietly fixed in a few months.
Response from the Home Connect team:
Thank you for contacting us.
Indeed the expected response for that query should be:
"data": { "key": "BSH.Common.Setting.PowerState", "value": "BSH.Common.EnumType.PowerState.On", "type": "BSH.Common.EnumType.PowerState", "constraints": { "allowedvalues": [ "BSH.Common.EnumType.PowerState.On" ], "default": "BSH.Common.EnumType.PowerState.On", "access": "read" } } }
We will proceed with that case internally.
Have a nice day ahead!
Description of Issue
Switch for (unsupported) Hob / Fridge-Freezer is created
Plugin Version
0.24.1
Home Connect Appliance(s)
Siemens Hob EX601JYW1E Siemens Fridge KA92DHB31
HomeKit App(s)
Switch On / Off
Diagnostic Checks
-
Log File
[10/04/2022, 21:06:30] [HomeConnect] [Hob] Home Connect API error: BSH.Common.Setting.PowerState currently not available or writable [SDK.Error.InvalidSettingState] [10/04/2022, 21:06:30] [HomeConnect] [Hob] SET BSH.Common.Setting.PowerState=BSH.Common.EnumType.PowerState.Off [10/04/2022, 21:06:30] [HomeConnect] [Hob] PUT https://api.home-connect.com/api/homeappliances/SIEMENS-EX601JYW1E-/settings/BSH.Common.Setting.PowerState
[10/04/2022, 20:51:46] [HomeConnect] [Fridge freezer] Home Connect API error: BSH.Common.Setting.PowerState currently not available or writable [SDK.Error.InvalidSettingState] [10/04/2022, 20:51:46] [HomeConnect] [Fridge freezer] SET BSH.Common.Setting.PowerState=BSH.Common.EnumType.PowerState.Off [10/04/2022, 20:51:46] [HomeConnect] [Fridge freezer] PUT https://api.home-connect.com/api/homeappliances/SIEMENS-KA92DHB31-/settings/BSH.Common.Setting.PowerState