Siemens/Bosch Home Connect Ecosystem

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by Xavier82 »

I got it partially working....

As we know something has changed on home-connect.
When creating an application there are 2 options for OAuth Flow:
1. Authorization Code Grant Flow
2. Device Flow

When visiting the home-connect APi documentatie site https://api-docs.home-connect.com/authorization/ for authorisation then there can be read that both flows require user input.

Therefor I have adjusted the code which can be found on https://github.com/Xavier82/Domoticz-Ho ... ect-Plugin
Modifications:
1. file added (config.py)
2. files modified (plugin.py and homeconnecthelper.py)

I own only a dishwasher so thats the only device I could test with.
But I think the modifications which I did are useable for other devices.

To install use the same instructions as mentioned on https://github.com/mario-peters/Domotic ... ect-Plugin in the wiki.

Make sure to have a login at https://singlekey-id.com/nl/home/ or migrated from home-connect.com to singlekey-id.com and you have the app installed.

Steps to be taken:
go to https://developer.home-connect.com/ create an account, make sure the account has the same username/emailaddress as your home-connect/SinglekeyID account and the same password!

next create an application (based on device flow)
Copy the client_id

In Domoticz the hardware plugin:
paste the client_id in the hardware plugin and make sure you have the correct device E-number and the correct scope.
Do not press "ADD" yet!!

First open the file homeconnecthelper.py on the directory /domoticz/plugins/Domoticz-Home-Connect-Plugin and add the client_ID number.
The add the APP_NAME in the file, which has to be the same name as used in the developer.home-connect.com created application.
Save the file.

go back to Domoticz and press "Add".

Go to the logging.
If everything went ok you will see some logging lines:

Code: Select all

Siemens Home Connect: <Response [200]>
Siemens Home Connect: device_code: XXXXX-AAAAAA-BBBBB-CCCCC-DDDDDDDDDDDDD
Siemens Home Connect: verification_uri_complete: https://api.home-connect.com/security/oauth/device_verify?user_code=XXXX-XXXX
Siemens Home Connect: Device "XXXXX-AAAAAA-BBBBB-CCCCC-DDDDDDDDDDDDD" is authorized by Home-Connect.
Siemens Home Connect: {
"error": "authorization_pending",
"error_description": "The authorization request is still pending as the end-user hasn't yet completed the user interaction steps"
}
Siemens Home Connect: Device "XXXXX-AAAAAA-BBBBB-CCCCC-DDDDDDDDDDDDD" has token:
Siemens Home Connect: Visit the following URL to complete the authorization: https://api.home-connect.com/security/oauth/device_verify?user_code=XXXX-XXXX
Copy the link

Code: Select all

https://api.home-connect.com/security/oauth/device_verify?user_code=XXXX-XXXX
from the logging to a webbrowser.
You will need to login with username/email on home-connect.com after pressing login you will be forwarded to singlekey-id.com and you will be requested to enter the password. After password you need to grant access, press the approve button, you will now see the remark notification "You have granted access to the device. Please check your device for next steps."

Next go back quickly to Domoticz logging...if everything went well you will now see something like:

Code: Select all

Siemens Home Connect: Access Token: REALLY.LONG.TOKEN_CODE
Siemens Home Connect: Enumber: SNxxxxxxx/14
Siemens Home Connect: haId: haIdnumber
Siemens Home Connect: Listen on Home-Connect Webserver - Port: 8085
Now devices should be created.
Not all devices are in the code yet, nor their features.

Main script is owned by MarioPeters.

I can't give a lot of support, sorry for that.

Things to fix:

Code: Select all

Error: Siemens Home Connect: HTTP Error: 429 Client Error: Too Many Requests for url: https://api.home-connect.com/api/homeappliances/XXXXXXXXXXXX/settings/BSH.Common.Setting.PowerState
Something in plugin.py on heartbeat

Code: Select all

Amount-based Rate Limits
Generally if too many requests are sent, further requests are rejected with the HTTP status code 429.

The following limits are currently configured:

10 event monitoring channels per client and Home Connect user account at any time (the request for further channels will be blocked)
10 requests per second on average (20 requests max. burst) with leaky bucket algorithm, otherwise HTTP 429 error
In some cases the plugin dies and stops, didn't looked into that yet.
garycooper
Posts: 21
Joined: Sunday 10 March 2019 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by garycooper »

Hi, I'm intersted about an issue to had my Washer-Dryer.

Thanks
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by dyter »

I can't get it to work, missing informations for me.
The android app can work without cloud, it is possible to connect the dishwasher directely to domoticz in the local address ip lan ?

Code: Select all

2024-01-29 17:28:51.779 Error: Lave Vaisselle: (Domoticz-Home-Connect-Plugin) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/bosh/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'.
2024-01-29 17:28:51.781 Error: Lave Vaisselle: Traceback (most recent call last):
2024-01-29 17:28:51.781 Error: Lave Vaisselle: File "/opt/domoticz/userdata/plugins/bosh/plugin.py", line 60, in <module>
2024-01-29 17:28:51.781 Error: Lave Vaisselle: import homeconnecthelper
2024-01-29 17:28:51.781 Error: Lave Vaisselle: File "/opt/domoticz/userdata/plugins/bosh/homeconnecthelper.py", line 5, in <module>
2024-01-29 17:28:51.781 Error: Lave Vaisselle: from sseclient import SSEClient
2024-01-29 17:28:51.781 Error: Lave Vaisselle: ModuleNotFoundError: No module named 'sseclient'
2024-01-29 17:29:16.023 Reolink Entree: Send Off to Person
2024-01-29 17:30:04.430 Error: Lave Vaisselle hardware (29) thread seems to have ended unexpectedly
2024-01-29 17:30:18.433 Error: Lave Vaisselle hardware (29) thread seems to have ended unexpectedly
2024-01-29 17:30:28.044 Reolink Parking: Send On to Person
2024-01-29 17:30:32.436 Error: Lave Vaisselle hardware (29) thread seems to have ended unexpectedly
2024-01-29 17:30:46.438 Error: Lave Vaisselle hardware (29) thread seems to have ended unexpectedly
2024-01-29 17:31:00.441 Error: Lave Vaisselle hardware (29) thread seems to have ended unexpectedly
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by Xavier82 »

@dyter
Did you install sseclient?
To connect to (dish)washer/dryer you need the cloud, direct connection to device is not possible.
User avatar
dyter
Posts: 40
Joined: Thursday 08 February 2018 15:48
Target OS: NAS (Synology & others)
Domoticz version: 8841
Location: Lyon
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by dyter »

Xavier82 wrote: Thursday 01 February 2024 9:50 @dyter
Did you install sseclient?
To connect to (dish)washer/dryer you need the cloud, direct connection to device is not possible.


Thanks, I install it with pip install sseclient and it start, but I have a many errors messages after connexion success and only Lave-Vaisselle - Door State is created:

Code: Select all

2024-02-08 19:33:47.206 Lave-Vaisselle: Enumber: SMV2ITX17E/46
2024-02-08 19:33:47.209 Lave-Vaisselle: haId: 403110520721054326
2024-02-08 19:33:48.581 Error: Lave-Vaisselle: Call to function 'onStart' failed, exception details:
2024-02-08 19:33:48.584 Error: Lave-Vaisselle: Traceback (most recent call last):
2024-02-08 19:33:48.585 Error: Lave-Vaisselle: File "/opt/domoticz/userdata/plugins/homeconnect/plugin.py", line 491, in onStart
2024-02-08 19:33:48.585 Error: Lave-Vaisselle: _plugin.onStart()
2024-02-08 19:33:48.585 Error: Lave-Vaisselle: File "/opt/domoticz/userdata/plugins/homeconnect/plugin.py", line 194, in onStart
2024-02-08 19:33:48.585 Error: Lave-Vaisselle: Devices[1].Update(nValue=Devices[1].nValue,sValue=operationstate.rpartition(".")[2])
2024-02-08 19:33:48.585 Error: Lave-Vaisselle: KeyError: 1
2024-02-08 19:33:48.992 Error: Lave-Vaisselle: Call to function 'onHeartbeat' failed, exception details:
2024-02-08 19:33:48.993 Error: Lave-Vaisselle: Traceback (most recent call last):
2024-02-08 19:33:48.993 Error: Lave-Vaisselle: File "/opt/domoticz/userdata/plugins/homeconnect/plugin.py", line 519, in onHeartbeat
2024-02-08 19:33:48.993 Error: Lave-Vaisselle: _plugin.onHeartbeat()
2024-02-08 19:33:48.993 Error: Lave-Vaisselle: File "/opt/domoticz/userdata/plugins/homeconnect/plugin.py", line 461, in onHeartbeat
2024-02-08 19:33:48.993 Error: Lave-Vaisselle: Devices[2].Update(nValue=Devices[2].nValue, sValue=getPowerState.rpartition(".")[2])
2024-02-08 19:33:48.993 Error: Lave-Vaisselle: KeyError: 2
And I don't know what URL I must make ?
Image

and bash don't want to start !

Code: Select all

root@DISKSTATION:/opt/domoticz/userdata/plugins/homeconnect# bash homeconnectSSE_Dishwasher.sh start
Starting system homeconnectSSE_Dishwasher daemon:.
root@DISKSTATION:/opt/domoticz/userdata/plugins/homeconnect# bash homeconnectSSE_Dishwasher.sh status
/opt/domoticz/userdata/plugins/homeconnect/homeconnectSSE.py is not running ... failed!
oot@DISKSTATION:/opt/domoticz/userdata/plugins/homeconnect# bash homeconnectSSE.sh start
Starting system homeconnectSSE_Dishwasher daemon:.
root@DISKSTATION:/opt/domoticz/userdata/plugins/homeconnect# bash homeconnectSSE.sh status
/opt/domoticz/userdata/plugins/homeconnect/homeconnectSSE.py is not running ... failed!
Domoticz v2024.1 on Synology Docker host, RFLink, ESPEasy wemos D1, Ecodevices, relays x8, dahua doorbell, reolink cameras ....
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by Xavier82 »

Hi @dyter, I see u use Domoticz in Docker on Synology.

I experienced a lot of issues with Synology, mainly because of other folderstructure and userrights, I migrated to Raspberry Pi.
I can't explain or fix these errors.....
eddieb
Posts: 279
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by eddieb »

Hi,

I am fighting with this plugin too

I installed the extra module with pip3 and the .sh seems to run fine.
BUT the domoticz listener on port 8399 does not start

Code: Select all

2024-06-03 13:05:56.514  Home Connect: Worker thread started.
2024-06-03 13:05:56.514  Status: Home Connect: Started.
2024-06-03 13:05:58.155  Status: Home Connect: Initialized version 3.2.1, author 'Mario Peters'
2024-06-03 13:05:58.158  Home Connect: onStart called Domoticz-Home-Connect-Plugin
2024-06-03 13:05:58.373  Home Connect: device_code: 42886e59-c80a-40c2-a9aa-xxxxxxxxxx
2024-06-03 13:05:58.373  Home Connect: verification_uri_complete: https://api.home-connect.com/security/oauth/device_verify?user_code=xxxxxxxxxx
2024-06-03 13:05:58.613  Home Connect: sessionid: html>
2024-06-03 13:05:58.679  Home Connect: Device "42886e59-c80a-40c2-a9aa-xxxxxxxxxx" is authorized by Home-Connect.
2024-06-03 13:05:58.918  Home Connect: Device "42886e59-c80a-40c2-a9aa-xxxxxxxxxx" has token: 
2024-06-03 13:05:59.068  Error: Home Connect: Call to function 'onStart' failed, exception details:
2024-06-03 13:05:59.071  Error: Home Connect: Traceback (most recent call last):
2024-06-03 13:05:59.072  Error: Home Connect:   File "/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py", line 459, in onStart
2024-06-03 13:05:59.072  Error: Home Connect:     _plugin.onStart()
2024-06-03 13:05:59.072  Error: Home Connect:   File "/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py", line 95, in onStart
2024-06-03 13:05:59.072  Error: Home Connect:     self.haId = homeconnecthelper.gethaId(self,Parameters["Mode1"],Parameters["Mode4"])
2024-06-03 13:05:59.072  Error: Home Connect:   File "/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/homeconnecthelper.py", line 91, in gethaId
2024-06-03 13:05:59.072  Error: Home Connect:     Domoticz.Debug(key + " --> " + str(item[key]))
2024-06-03 13:05:59.072  Error: Home Connect: TypeError: string indices must be integers
I read this thread over and over, tried everything that was sugegsted but no luck ...

any sugegstions ???
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest