Legrand/Bticino MyHome

Yes, I made an action in HA and a routine in Google home


Many tnx!!

Hi Julien,
I installed MyHome Integration and if I try to launch the configuration from UI I obtain the following error.

Can you help me ?
I’am using HA SO and try to connect to a MH201 gateway .

Thank you

Logger: aiohttp.server
Source: custom_components/myhome/config_flow.py:112
Integration: MyHome (documentation, issues)
First occurred: 23:03:43 (1 occurrences)
Last logged: 23:03:43

Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py”, line 435, in _handle_request
resp = await request_handler(request)
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py”, line 117, in impl
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 60, in security_filter_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/forwarded.py”, line 100, in forwarded_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 28, in request_context_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 82, in ban_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 236, in auth_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 136, in handle
result = await result
File “/usr/src/homeassistant/homeassistant/components/config/config_entries.py”, line 148, in post
return await super().post(request)
File “/usr/src/homeassistant/homeassistant/components/http/data_validator.py”, line 73, in wrapper
result = await method(view, request, data, *args, **kwargs)
File “/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py”, line 71, in post
result = await self._flow_mgr.async_init(
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 225, in async_init
flow, result = await task
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 252, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data, init_done)
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File “/config/custom_components/myhome/config_flow.py”, line 109, in async_step_user
local_gateways = [
File “/config/custom_components/myhome/config_flow.py”, line 112, in
if dr.format_mac(f’{MACAddress(user_input[“serialNumber”])}’) not in already_configured
TypeError: ‘NoneType’ object is not subscriptable

Hi, I am trying to use MyHome in my HomeAssistant container installation. Tried manually, adding to /config/custom… and also using HACS, same result:

2022-10-29 21:45:04.009 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py”, line 435, in _handle_request
resp = await request_handler(request)
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py”, line 117, in impl
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 60, in security_filter_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/forwarded.py”, line 100, in forwarded_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 28, in request_context_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 82, in ban_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 236, in auth_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 136, in handle
result = await result
File “/usr/src/homeassistant/homeassistant/components/config/config_entries.py”, line 148, in post
return await super().post(request)
File “/usr/src/homeassistant/homeassistant/components/http/data_validator.py”, line 73, in wrapper
result = await method(view, request, data, *args, **kwargs)
File “/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py”, line 71, in post
result = await self._flow_mgr.async_init(
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 225, in async_init
flow, result = await task
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 252, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data, init_done)
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File “/config/custom_components/myhome/config_flow.py”, line 109, in async_step_user
local_gateways = [
File “/config/custom_components/myhome/config_flow.py”, line 112, in
if dr.format_mac(f’{MACAddress(user_input[“serialNumber”])}’) not in already_configured
TypeError: ‘NoneType’ object is not subscriptable

Discover seems to work correctly:

(inside container):
bash-5.1# pwd
/usr/local/lib/python3.10/site-packages/OWNd

bash-5.1# python3 discovery.py
Address: 192.168.88.xx
Port: 20000
Manufacturer: Legrand S.p.A.
Model: F455
Firmware: 1.0
Serial: 00:0x…

Any ideas?

Using Home Assistant 2022.10.5 with python 3.10 (not 3.8)

Thanks for helping me :slight_smile:

Hi guys… Julien
With Home Assistant 2022.11 I have some problems…

  1. At random MyHome Integration no longer communicates
  2. I need to reload config

This log now appear with Allarm System Pannel when I ARM…

2022-11-08 00:07:53.901 WARNING (MainThread) [custom_components.myhome] Unknown device: WHO=9 WHERE=7
2022-11-08 00:07:55.159 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 956, in __init__
    self._sensor = int(self._where[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.170 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.179 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 956, in __init__
    self._sensor = int(self._where[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.181 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.237 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.238 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.240 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.241 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.242 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.243 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.293 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.296 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.410 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 956, in __init__
    self._sensor = int(self._where[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.413 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.416 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 956, in __init__
    self._sensor = int(self._where[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.420 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.488 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.491 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.584 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.587 WARNING (MainThread) [custom_components.myhome] Data received is not a message: None
2022-11-08 00:07:55.659 ERROR (MainThread) [custom_components.myhome] Event session crashed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/OWNd/connection.py", line 582, in get_next
    return OWNMessage.parse(data.decode())
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 166, in parse
    return OWNEvent.parse(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 309, in parse
    return OWNAlarmEvent(data)
  File "/usr/local/lib/python3.10/site-packages/OWNd/message.py", line 951, in __init__
    self._sensor = int(self._zone[1:])
ValueError: invalid literal for int() with base 10: ''
2022-11-08 00:07:55.662 WARNING (MainThread) [custom_components.myhome] Data received is not a message:

This is the automation

alias: AI - ARM from HA
description: >-
  ARM 
trigger:
  - platform: state
    entity_id: alarm_control_panel.casa
    from: disarmed
    to: arming
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            state: "off"
            entity_id: binary_sensor.ai_serramenti
        sequence:
          - service: myhome.send_message
            data:
              message: "*9*1*7##"
      - conditions:
          - condition: state
            entity_id: binary_sensor.ai_serramenti
            state: "on"
        sequence:
          - service: alarm_control_panel.alarm_disarm
            target:
              entity_id: alarm_control_panel.casa
            data:
              code: "zyx"
          - service: notify.all_smartphones
            data:
              title: ARM Failed
              message: >-
                {% for s in
                states|selectattr('entity_id','in',state_attr('binary_sensor.ai_serramenti','entity_id'))
                if s.state == 'on' or s.state == 'open'-%} {% if not loop.first
                %}{% if loop.last %} and {% else %}, {% endif %}{% endif -%} {{
                s.name }} {%- if loop.last %} {% if not loop.first %}is {% else
                %}e'{% endif %} still open!{% endif %} {%- endfor %}
    default: []
mode: single

Where:

binary_sensor.ai_serramenti → is a group of contact sensors
"*9*1*7##" → is OpenWebNet Message to use AUX command that is caputured by my Allarm Central unit (3486)

Aren’t there other people whose integration gets stuck?
But I don’t think it’s due to this …

Thanks

Hi @anotherjulien ,

I currently have the same problem suggested by @nicolacavallo84 in the post above.
HVAC heating condition is not recorded anymore and makes the integration crash (lost communication with the server).
Currently running HA 2022.10.5 and MyHOME component version “Master” (same as github).

Would be nice if you could take a look to your code. The related error which is appearing in HA is:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/myhome/climate.py:458
Integration: MyHome (documentation, issues)
First occurred: November 10, 2022 at 10:13:41 PM (11 occurrences)
Last logged: 3:41:35 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/myhome/gateway.py", line 231, in listening_loop
    ].handle_event(message)
  File "/config/custom_components/myhome/climate.py", line 458, in handle_event
    self._attr_hvac_action = HVACAction.HEAT
  File "/usr/local/lib/python3.10/enum.py", line 437, in __getattr__
    raise AttributeError(name) from None
AttributeError: HEAT

Let me know if I need to run further debugging tests.
Thanks for the support.

Hi @anotherjulien, I made a pull request to fix the problem highlighted above (integration crashes when HVAC changes to heating condition).
Can you please merge it to the master or/and make a new version?

Thanks!

2 Likes

Hi all,
the winter is arriving and when i put on my heating system in HA, nothing is working anymore.
the thermostat cards do not updating anymore??
has anyone the same problems ??
i also see a lot of questions passing for “Julien” unanswered ??
@anotherjulien are you giving up maintaining the integration??
Hope to here from you…
Regards,
Dirk

Problem solved! My Ethernet Switch is the problem… I changed it and now is OK

1 Like

I’ll be maintaining enough for it to work for me.
I don’t have heating system with MyHome, so it’s liable to break any time HA changes yet another time.
For now, I’ve merged @IAmVespa’s fix in the master release. If it works, that’s great.

2 Likes

Hello Julien, guys.
Is the github repo down only for me this evening?
I can’t install it. It keeps saying “GitHub - anotherjulien/MyHOME: MyHOME integration for Home-Assistant is not a valid add-on repository”.
And i can’t find it in the Official addon part nor in the Home Assistant community addons part.

What i could be doing wrong???
I’m on a:
Home Assistant 2022.12.6
Supervisor 2022.11.2
Operating System 9.4
Frontend 20221213.0 - latest

Thx in advance.
Bye
Giorgio

It’s a custom component not an addon.
Bye
Sandro

Thank you so much.
So you have to install HACS component BEFORE … Then you can search and install AnotherJulien component.

Fine.
Thank you
bye
Giorgio

Hi @loreboldo,
I have a BT4200 alarm lire you and I would like to receive live status like you do.
My BT4200 is connected to my local network and the IP Events are activate on port 2024.
Can you explain me how you catch informations on TCP please ?
Thanks for your help.

Hi @illidan05, as commented in a previous response, I use Node-RED to collect TCP/IP events (from the Alarm I used to send them to the Raspberry running automation) and parse them using a RegEx. Unfortunately since then I moved house and I don’t have that setup anymore so I can’t share code/screenshots.

Hello Julien,
I’m a new home assistant user, I’m trying to install OWNd on my HA but I didn’t get how to do it (I’m really a rookie :cry:). I’ve tryed both with Add-on (HACS) and devices, but no way I got anytime errors. May I ask you some suggestion how to proceed?
thank you
Alberto

Hello,

I’m trying to install myhome and I always get the same error.

File “/config/custom_components/myhome/config_flow.py”, line 112, in
if dr.format_mac(f’{MACAddress(user_input[“serialNumber”])}') not in already_configured
TypeError: ‘NoneType’ object is not subscriptable

I have tried to put the gateway manually in the code but I get nothing,

Did you finally solve the problem?

Thanks

Hello,

I have pressed the button on the MH201 gateway just at the time of myhome installation and the gateway was discovered automatically

Hi @toixop,

I had the same error. Changing line 112 in config_flow.py to check the variable gateway instead of user_input did the job for me and I was able to finish the configuration.

if dr.format_mac(f'{MACAddress(gateway["serialNumber"])}') not in already_configured

Hope that helps.

Great job @nik-bauer, this fixed my issue!