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.
Post Reply
korniza
Posts: 198
Joined: Thursday 27 August 2015 18:12
Target OS: Raspberry Pi
Domoticz version: V3.6028
Location: Greece
Contact:

Siemens/Bosch Home Connect Ecosystem

Post by korniza » Sunday 26 March 2017 11:18

Hello,
Electric appliances are getting more and more connected to wifi and get some way smart abilities I decided to move on a renewal of our home washing machine that can be controlled through wifi. I bought a siemens washing machine with Home Connect ability.
Siemens and Bosch build Home Connect which are used on both brands. They have a development community established (https://developer.home-connect.com/ ) and also there are some opensource home automation software that they are support them ( https://forum.fhem.de/index.php/topic,29353.0.html).

Do you have any plan to support Home Connect as I suppose more people will getting smart appliances. I tested also Samsung smart washing machine BUT 1. it did not connect to wifi 2. it is dummy compering with siemens appliances 3. People are reporting major failures on Samsung washing machines after 2-3 years use. Siemens/Bosch have matured customer support.
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)

User avatar
robpow
Posts: 84
Joined: Friday 19 July 2013 19:28
Target OS: Raspberry Pi
Domoticz version: Beta :)
Location: .se
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by robpow » Sunday 26 March 2017 11:56

Looks promising and could be very useful if for instance the laundry room is in the basement.

I hope there will be a way to interact with the appliances directly to avoid dependency on a central server on the web and an internet connection. Also it reduced the risk of getting hacked, don't want my appliances to become part of a botnet!

Matt

korniza
Posts: 198
Joined: Thursday 27 August 2015 18:12
Target OS: Raspberry Pi
Domoticz version: V3.6028
Location: Greece
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by korniza » Sunday 26 March 2017 12:21

if somebody likes to give a try and migrate existing implementation for FHEM to Domoticz here is the code

https://github.com/sw-home/FHEM-HomeConnect
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)

korniza
Posts: 198
Joined: Thursday 27 August 2015 18:12
Target OS: Raspberry Pi
Domoticz version: V3.6028
Location: Greece
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by korniza » Tuesday 24 October 2017 19:50

(Yes I am back!)

I like to share the experience with Home Connect platform. We can use it, passing data from HomeConnect API -> FHEM->Node-red (MQTT) -> Domoticz.
It is long story and many things are required to get communication with FEHM community. I will try to build a howto step by step on future if there is a request.

ps. I glad to be back to Domoticz community after a short exploration of other home automation platforms
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)

jkimmel
Posts: 186
Joined: Monday 25 November 2013 18:51
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by jkimmel » Wednesday 25 October 2017 11:51

korniza wrote:
Tuesday 24 October 2017 19:50
(Yes I am back!)

I like to share the experience with Home Connect platform. We can use it, passing data from HomeConnect API -> FHEM->Node-red (MQTT) -> Domoticz.
It is long story and many things are required to get communication with FEHM community. I will try to build a howto step by step on future if there is a request.

ps. I glad to be back to Domoticz community after a short exploration of other home automation platforms
+1
Rfxcom

korniza
Posts: 198
Joined: Thursday 27 August 2015 18:12
Target OS: Raspberry Pi
Domoticz version: V3.6028
Location: Greece
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by korniza » Wednesday 25 October 2017 18:57

FHEM
First we need to install fhem. it uses 8083/8084/8085 ports for web interface so we are safe if we use default 8080 port on domoticz.
Read on installation section howto:
https://fhem.de/

after we need to telnet on machine that fhem has been installed on port 7072. after follow the following link for homeconnect setup.
Be Careful! register a developer account with the email you registered your appliances!

https://wiki.fhem.de/wiki/HomeConnect

this is the simulator setup. next step is to create an account of fhem forum and read some basic steps on the post of swhome.
https://forum.fhem.de/index.php/topic,2 ... #msg521831
When all are finished you need to remove the "simulator" from previous link you entered on configuration of fhem. Restart fhem and select from drop-down menu on hcconn :Scandevices.
YES! you will get back all your related devices! Now things are different according your devices you have. The common part is to press on each appliance that are found on FHEM to select RequestSettings so to return the "readings" (temperature,status, etc.).
Now you can see the status of your appliances in real time!

Next step is get install mosquitto and on top node-red if it not already installed. I can not cover this part as there are so many ways and for so many systems (debian/ubuntu, raspberry, synology).

Next step: build a bridge from FHEM -> MQTT
follow steps on this link to install MQTT on FHEM: https://wiki.fhem.de/wiki/MQTT_Einf%C3%BChrung

Next, you need to add on fhem.cfg the following as example

Code: Select all

define MyBroker MQTT 127.0.0.1:1883

define mqtt_KG39FPI45 MQTT_BRIDGE KG39FPI45
attr mqtt_KG39FPI45 IODev MyBroker
attr mqtt_KG39FPI45 publishReading_BSH.Common.Setting.PowerState fhem/out/fridge
attr mqtt_KG39FPI45 publishReading_BSH.Common.Status.DoorState fhem/out/fridge
attr mqtt_KG39FPI45 publishReading_Refrigeration.FridgeFreezer.Setting.SetpointTemperatureFreezer fhem/out/fridge
attr mqtt_KG39FPI45 publishReading_Refrigeration.FridgeFreezer.Setting.SetpointTemperatureRefrigerator fhem/out/fridge
attr mqtt_KG39FPI45 publishReading_Refrigeration.FridgeFreezer.Setting.SuperModeFreezer fhem/out/fridge
attr mqtt_KG39FPI45 publishReading_Refrigeration.FridgeFreezer.Setting.SuperModeRefrigerator fhem/out/fridge
attr mqtt_KG39FPI45 publishReading_state fhem/out/fridge
attr mqtt_KG39FPI45 stateFormat transmission-state
define <broker name> MQTT <ip.addr.of.mosquitto>:<port>

define <mqtt_device> MQTT_BRIDGE <real device name that was registered on previous steps>
attr <mqtt_device> IODev <broker name>

Save and restart.Now you have a new device on FHEM web gui that is named <mqtt_device>. The fast way is to open this device and press get readings. It will populate all the parameters on a list of MQTT topics.

After that you are ready to move on node-red and build mqtt-inputs with these topics.
hoping you are familiar with MQTT language, you can export these readings to domoticz using MQTT device using MQTT Client Gateway with LAN interface on domoticz.

I am also new to node-red so I try to build a flow that is compatible with domoticz to update values on domoticz (temperature) and return back to FHEM commands on controlling appliances parameters (temperature, etc).

I wish I had a better guide, but for now is a draft. hope some day domoticz will not need so many 3rd party software to interact with homeconnect ecosystem.
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)

mariopeters
Posts: 4
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by mariopeters » Thursday 23 August 2018 14:48

After some hours of programming my first version of the Domoticz Home Connect plugin https://github.com/mario-peters/Domotic ... ect-Plugin is ready.
More features will follow

nschoot
Posts: 11
Joined: Thursday 23 August 2018 23:28
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Delwijnen
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by nschoot » Monday 03 September 2018 16:27

Very nice initiative! I'll try this out somewhere this week. I have a HomeConnect dishwasher, two ovens and a furnace (all Siemens)... So I'll be happy to do some experimenting and possibly even some tweaking of the code to make them work... I

jake
Posts: 439
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by jake » Monday 03 September 2018 23:17

Is it only monitoring that you can do? It would be cool (literally) to control the setpoint to lower the freezer temperature based on solar panel energy that is now fed back to the grid.

This way the freezer could act as a battery for the night, in which energy communion can be reduced to let the freezer heat up to it's normal freezing temperature

nschoot
Posts: 11
Joined: Thursday 23 August 2018 23:28
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Delwijnen
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by nschoot » Monday 03 September 2018 23:59

Unfortunately it's not working for me... do i need specific python packages to be installed?

Error:

2018-09-03 23:57:01.613 Error: (Home-Connect) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-09-03 23:57:01.613 Error: (Dishwasher) Module Import failed, exception: 'ImportError'
2018-09-03 23:57:01.613 Error: (Dishwasher) Module Import failed: ' Name: requests'
2018-09-03 23:57:01.613 Error: (Dishwasher) Error Line details not available.


To answer my own question: I needed to install sseclient, which installs a number of dependencies, including requests.
So, now the plugin at least initializes... But I run into the next problem:

Code: Select all

2018-09-04 00:16:57.164 Error: (Dishwasher) 'onHeartbeat' failed 'NameError':'name 'request' is not defined'.
2018-09-04 00:16:57.164 Error: (Dishwasher) ----> Line 136 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py', function onHeartbeat
2018-09-04 00:16:57.164 Error: (Dishwasher) ----> Line 87 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py', function onHeartbeat
2018-09-04 00:16:57.164 Error: (Dishwasher) ----> Line 43 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/homeconnecthelper.py', function refreshToken
does "request" need to be imported from somewhere?

Not entirely sure what I'm doing, but I replaced "request" with "requests"... now I'm getting:

Code: Select all

2018-09-04 00:43:57.546 Error: (Dishwasher) 'onHeartbeat' failed 'TypeError':'string indices must be integers'.
2018-09-04 00:43:57.546 Error: (Dishwasher) ----> Line 136 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py', function onHeartbeat
2018-09-04 00:43:57.546 Error: (Dishwasher) ----> Line 91 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py', function onHeartbeat
2018-09-04 00:43:57.546 Error: (Dishwasher) ----> Line 84 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/homeconnecthelper.py', function gethaId
Giving up for today....

tabkon
Posts: 1
Joined: Tuesday 04 September 2018 2:47
Target OS: Windows
Domoticz version:
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by tabkon » Tuesday 04 September 2018 2:51

oh nice

nschoot
Posts: 11
Joined: Thursday 23 August 2018 23:28
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Delwijnen
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by nschoot » Tuesday 04 September 2018 9:55

Slightly more elaborate log lines... I don't get any debug message in the log though...
Also, note that "self.access_token" is empty...

Code: Select all

2018-09-04 09:47:27.602  (Dishwasher) 2018-09-04 09:47:27.601913 onHeartbeat called
2018-09-04 09:47:29.371  (Dishwasher) Device "14916875-b74c-43e4-b954-43b1a5c3d600" is authorized by Home-Connect.
2018-09-04 09:47:30.731  (Dishwasher) Device "14916875-b74c-43e4-b954-43b1a5c3d600" has token:
2018-09-04 09:47:31.006  (Dishwasher) error --> {'description': 'Authentication is possible but has failed or not yet been provided.', 'key': '401'}
2018-09-04 09:47:31.006  Error: (Dishwasher) 'onHeartbeat' failed 'TypeError':'string indices must be integers'.
2018-09-04 09:47:31.006  Error: (Dishwasher) ----> Line 136 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py', function onHeartbeat
2018-09-04 09:47:31.006  Error: (Dishwasher) ----> Line 91 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/plugin.py', function onHeartbeat
2018-09-04 09:47:31.006  Error: (Dishwasher) ----> Line 84 in '/home/pi/domoticz/plugins/Domoticz-Home-Connect-Plugin/homeconnecthelper.py', function gethaId
Looking forward to a new version ;)

nschoot
Posts: 11
Joined: Thursday 23 August 2018 23:28
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Delwijnen
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by nschoot » Tuesday 04 September 2018 14:59

Ok, I got a bit closer to a solution by finding out what the underlying authorization problem seems to be. Result getting from the home-connect API is:

"The authorization request is still pending as the end-user hasn't yet completed the user interaction steps"

Not sure what that means... Do I need to make my account a developer account?

nschoot
Posts: 11
Joined: Thursday 23 August 2018 23:28
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Delwijnen
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by nschoot » Tuesday 04 September 2018 15:48

This project's explanation was very useful (it's for openhab) and made me realize I need my own personal client-id

https://github.com/bruestel/org.openhab ... omeconnect

So I now got a bit further yet... I do get a token now, but now apparently the scope is not sufficient.

2018-09-04 15:39:38.055 Error: (Dishwasher) {
2018-09-04 15:39:38.055 "error": {
2018-09-04 15:39:38.055 "key": "insufficient_scope",
2018-09-04 15:39:38.055 "description": "Insufficient scope for this resource"
2018-09-04 15:39:38.055 }
2018-09-04 15:39:38.055 }

Not sure yet how to solve this one... I do not see "Dishwasher" in the list of granted scopes. I do see "Dishwasher-Monitor" though... I'll fiddle with it later since i'm apparently exceeding my 10 calls in 10 minutes :(

nschoot
Posts: 11
Joined: Thursday 23 August 2018 23:28
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Delwijnen
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by nschoot » Tuesday 04 September 2018 23:51

Ok, so what goes wrong is that I have 4 home-connect devices, of which one is the dishwasher (not the last) - see attached json. The function gethaID iterates over all the devices and uses the haId of the last device in the set.... Which is not the dishwasher in my case. I did a quick hack to make it select the dishwasher:

Code: Select all

for data in homeappliance:
            items = homeappliance[data]
            for item in items:
                if item["type"] == "Dishwasher":
                    for key in item:
                  ...
                  
I suppose gethaId will need another argument that specifies the device type....

So, now I have the dishwasher as a device in Domoticz... but what's next... what is it supposed to do?
2018-09-04 23_44_36-Clipboard.png
2018-09-04 23_44_36-Clipboard.png (32.66 KiB) Viewed 185 times
It doesn't log anything... so... What's next?
Attachments
devices.txt
(951 Bytes) Downloaded 9 times

mariopeters
Posts: 4
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Siemens/Bosch Home Connect Ecosystem

Post by mariopeters » Saturday 15 September 2018 20:17

The only feature I've now implemented is Dishwasher-Monitor.
I think there is a small bug, namely <option label="Dishwasher" value="Dishwasher" default="true"/> must be <option label="Dishwasher" value="Dishwasher-Monitor" default="true"/>

If your dishwasher is running, you should see the status changing in domoticz.
I'm working on a version 2, which is using the onCommand methods of Baseplugin to get the Domoticz performance a little bit better, but I still have an error when I try to post some data tot de url. Does anyone have experience with this?

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests