Legrand/Bticino MyHome

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?

I am running on a docker, and I access from localhost port 8123 so I think t’s sharing the host network. How can I check it? I repeat anyway that if I run Ownd from the container bash, it finds it

help!

— update:

now it doesn’t connect anymore also from the cli. It stays with “opening event session”

/config # python3.8 -m OWNd -v 2  -a 192.168.0.121 -p 20000 -P Gabriele1
2020-12-03 22:23:55,186 - OWNd - INFO - Starting OWNd.
2020-12-03 22:23:55,187 - OWNd - INFO - Opening event session.


If you do something like ifconfig from your container Bash, what do you get?
I usually run HassOS, with no problem, but if you’re running only the Home Assistant container in Docker, I’m not sure what needs to be done in terms of network to allow SSDP traffic to be forwarded to HA

I will install hassio in a vm and let you know when I am back at home. As i said this is a secondary deploymet for testing, I do not care at the moment of the installation method.

I have a problem with the integration. I explane what happens: I’ve both mhserver1 and F454. They are both discovered but when i configure my yaml, the sensors in lovelace give error. I go to cancel one server( for example F454), and all come to work, but when i restart HA it found the other server HA ask to me the config. I config it and all is in error. Please help me. Thanks

Don’t configure the second server, just click ignore.
On reboot it will no longer consider it, and it won’t ask you to set it up.

This is getting into fringe use cases I deliberately chose to ignore while developing the integration.
Can you tell me why you have two gateways, and why you need them both in Home Assistant?

Basically this integration is meant to be used with a single gateway because I could not conceive of any reason people would have two distinct SCS buses at home.
If you have two gateways on the same bus, then you only configure one into Home Assistant and ignore the other, and that should be all that is needed to work!