Legrand/Bticino MyHome

OK, you can now add “https://github.com/anotherjulien/MyHOME” as a custom repository in HACS :slight_smile:
In there, the first (and for now only) version available for install will be 0.7

I’ve tested the deployment from scratch on a RPi 3b+ and it worked without issues, so hopefully it’ll work fine for everybody :slight_smile:

Hi Julien,

you’ve been very quick, I can confirm that the integration installed correctly from HACS :slight_smile:, me too I’m using a RPi 3b+.
When I try to add the integration from the settings I get the no gateway found message though.
Using the python3.8 -m OWNd -v 2 command with gateway IP port and password (as hST tried before) it is able to connect to the MH201 and it correctly listens to the commands sent by the cover buttons.
Do you think this is an issue with the MH201 not being a “real” gateway but a scenario module?
Thanks for your work, if there’s something I can try or you would like to test, please let me know.

Hi julien, I’m trying to use your integration but I get this error:

“No gateway found”

I have a MH201 on the same network.

If I try to manually configure with:

myhome:
  ip_address: 192.168.0.***
  password: *****

I get these errors in the log:

Can you help me?

If you need more info, I can give you. I’m quite skilled and I’m also a dev.

@teejay-87, config of the gateway via YAML is indeed not supported.
Both you and @Hochram are reporting issues specifically with MH201 modules, that leads me to believe something is working differently with those.
Could either or both of you run this command in you Home Assistant instance?

python3.8 /usr/local/lib/python3.8/site-packages/OWNd/discovery.py

The output should be a list of discovered gateways with a few informations.

Command python3.8 is not found on my installation (home assistant supervised), unless my HA shows it’s running on 3.8.6. Probably because it runs in docker…?

Also the file does not exists, I only have a Python3.7 directory under /usr/local/lib with a dist-packages subdir.

docker exec -it homeassistant /bin/bash

That will get you inside the actual Home Assistant container, there you can run the command.
(Ctrl-D will get you out of it once you are done)

Hi Julien, for the answer to post # 34 I need to deepen …
I will not fail to write to you.

For Discovery in docker I see

bash-5.0 # python3.8 /usr/local/lib/python3.8/site-packages/OWNd/discovery.py
Address: 192.168.1.2
Port: 20000
Manufacturer: BTicino S.p.A.
Model: MH200N
Firmware: 1.0
Serial: 00:03: ****

Address: 192.168.1.2
Port: 20000
Manufacturer: BTicino S.p.A.
Model: MH200N
Firmware: 1.0
Serial: 00:03: ****
bash-5.0 #

If it can be useful, on the page ip: 80 mh201 I see this

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.22:80/</URLBase>
<device>
<deviceType>urn:schemas-bticino-it:device:IP scenario module:1</deviceType>
<friendlyName>Ingresso</friendlyName>
<manufacturer>BTicino S.p.A.</manufacturer>
<manufacturerURL>http://www.bticino.it</manufacturerURL>
<modelDescription>IP Scenario Module</modelDescription>
<modelName>MH201</modelName>
<modelNumber>1.0</modelNumber>
<modelURL>www.bticino.it</modelURL>
<serialNumber>00:****:A0</serialNumber>
<UDN>uuid:upnp-IPscenarioModule-1_0-00****A0</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-bticino-it:service:Reachability:1</serviceType>
<serviceId>urn:bticino-it:serviceId:Reachability</serviceId>
<SCPDURL>Reach_Serv.xml</SCPDURL>
<controlURL/>
<eventSubURL/>
</service>
</serviceList>
<presentationURL/>
</device>
</root>

Unlike the gateways, the info is probably on port 80?

edit
Last thing, if mh201 is connected, in the log this error appears (see below)
In fact, if I unplug it from the network and restart the home assistant does not exit,
and as I connect it to the network, it appears again.


2020-11-30 20:58:05 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 46, in initialize
    await scanner.async_scan(None)
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 74, in async_scan
    await self._process_entries(entries)
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 120, in _process_entries
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_init
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/config/custom_components/myhome/config_flow.py", line 231, in async_step_ssdp
    gateway = await OWNGateway.build_from_discovery_info(discovery_info)
  File "/usr/local/lib/python3.8/site-packages/OWNd/connection.py", line 99, in build_from_discovery_info
    discovery_info["port"] = await get_port(discovery_info["ssdp_location"])
  File "/usr/local/lib/python3.8/site-packages/OWNd/discovery.py", line 190, in get_port
    resp = await session.post(ctrl_url, data=soap_body, headers=headers)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 551, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 892, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 605, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
bash-5.0# python3.8 /usr/local/lib/python3.8/site-packages/OWNd/discovery.py
bash-5.0# 

No detail at all.

First of all I confused the actuator with the gateway!!! (not F401s!!! sorry… but F454 or Mhserver1)
I meant that maybe the roller shutters (H4661M2) should be combined with these gateways? (F454 or Mhserver1)
In any case with another program, the advanced mode, it works for me with the mh201, but not with mh200n (the same with your component … that’s why I was trying to make mh201 work heheh)

I made a video (I send the link in private) for the heating central unit and cover advenced mode with this setting:

climate:
  - platform: myhome
    devices:
      central_unit:
        zone: "#0"
        name: Central unit
        heat: True
        cool: False
        standalone: False
        manufacturer: BTicino
        model: 3550
      zone_1:
        zone: "1"
        name: Termo Camera
        heat: True
        cool: False
        standalone: False
        manufacturer: BTicino
        model: F430/4
##etcetc
      cover_studio:
        where: "29"
        name: Serranda Studio
        advanced: True
        manufacturer: BTicino
        model: LN4661M2

Forgive the delay, but I have changed jobs and also the location … lately I have little time, and I have difficulty writing in English: D

Hi Julien,

the discovery command gives me no output, just like teejay-87.
I also have the same errors in the log.

I just published a minor version of the OWNd library.
Could you guys try to edit manifest.json in the custom_component/myhome folder and change the requirement to "requirements": ["OWNd==0.7.12"],

Then you’ll need to restart Home-Assistant and test again.

Thanks!

1 Like

YESSS!!!
myhome1 myhome2

myhome4

2 Likes

Thanks! It works!

Hi all, I am currently using Sdomotica, but i would like to give a try to this integration for my personal understanding of home assistant integrations. Can anybody explain me how to install the integration? To avoid overlapping with my preexisting HA instance, I am now running on a separated docker.
I own a MHS1 server and a myhometouch that usually can act as a gateway. I own the bticino alarm 3486 and central 3550.
Sorry but I do not know how to perform basics steps
I hope that when it will be up and running I can give some help just in case
Ciao

It works!!
Great job! :smiley:

@gabriele.rendina you have first to install HACS on your Home Assistant and then install the myhome integration, you will find it in the list of available integrations.

OK, it installed but no gateway present in configuration.

The point is that using python command I see the gateway and I can see the own messages correctly. Unfortunately the gateway discovery is not saved. I am using MHS1.

python3.8 -m OWNd -v 2 -a 192.168.0.121 -p 20000 -P zxxzxz works, but it does not work if I do not specify the address. Could it be a problem related to the address itself? I see that other people with 192.168.1.xxx are not getting error…

Ciao

The address is not a problem, I’m not even in the 192.168.. range at all at home.
It’s unexpected however that Home Assistant does not discover the gateway on its own and suggest adding it.

You can still try to add it “manually”.
Adding the MyHome integration from the “Integrations” pane will trigger a discovery (through OWNd) and you should be able to add your gateway.

If I add the integration it just says that It can’t find a gateway and does not allow a manual entry!

Did you modify the manifest.json? If I’m not wrong Julien hasn’t updated it yet in the repository.

The fix in OWNd should only be necessary with MH201 (and maybe F455) gateways.
Gabriele apparently has a MyHomeServer1.

However, can you confirm that your Home Assistant instance and your gateway are in the same network? I.E. is your Home Assistant in the 192.168.0.0/24 range?