Legrand/Bticino MyHome

I solved my problem.
Looking at the log I see these lines:

[MH201 gateway - 192.168.1.32] Message `*#1*0205##` was successfully sent.
[MH201 gateway - 192.168.1.32] Message received: `*1*0*25##`

which I guess is the status request and the answer. The second line is also repeated after the commands to turn on-off the light. It should be the new status confirming a status change.

Interestingly, the commands are sent for a where=0205, but the answer is sent for a where=25.
I changed the where to 25 (removing the zeros) in the yaml file and everything now works as expected.

I noticed something else in the logs. Normally, after the response arrives from the gateway, it is “interpreted” in a human readable fashion. See the following

2024-04-16 20:08:13.327 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Command session connection reset, retrying...
2024-04-16 20:08:13.328 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Opening command session.
2024-04-16 20:08:13.333 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Negotiating command session.
2024-04-16 20:08:13.336 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Received SHA challenge: `*98*2##`
2024-04-16 20:08:13.336 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Accepting sha256 challenge, initiating handshake.
2024-04-16 20:08:13.339 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Sending command session password.
2024-04-16 20:08:13.507 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*#18*51*51*584395##`
2024-04-16 20:08:13.507 INFO (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Sensor 1 is reporting a total power consumption of 584395 Wh.
2024-04-16 20:08:13.510 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` received response `*#18*51*51*584395##`.
2024-04-16 20:08:13.551 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` was successfully sent.
2024-04-16 20:08:15.203 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*#18*51*113*1550##`
2024-04-16 20:08:15.204 INFO (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Sensor 1 is reporting an active power draw of 1550 W.
2024-04-16 20:08:35.351 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*1000#0*13##`
2024-04-16 20:08:35.351 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Ignoring translation message `*1*1000#0*13##`
2024-04-16 20:08:35.400 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*0*13##`
2024-04-16 20:08:42.266 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*1000#0*13##`
2024-04-16 20:08:42.266 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Ignoring translation message `*1*1000#0*13##`
2024-04-16 20:08:42.319 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*0*13##`
2024-04-16 20:08:44.735 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*1000#0*13##`
2024-04-16 20:08:44.736 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Ignoring translation message `*1*1000#0*13##`
2024-04-16 20:08:44.786 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*0*13##`
2024-04-16 20:08:45.138 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*#18*51*113*1540##`
2024-04-16 20:08:45.139 INFO (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Sensor 1 is reporting an active power draw of 1540 W.

What I mean is

2024-04-16 20:08:13.507 INFO (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Sensor 1 is reporting a total power consumption of 584395 Wh.
2024-04-16 20:08:13.510 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` received response `*#18*51*51*584395##`.

When the integration get stuck, this does not happen anymore, as the loop is

2024-04-16 20:08:47.509 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*1000#1*13##`
2024-04-16 20:08:47.510 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Ignoring translation message `*1*1000#1*13##`
2024-04-16 20:08:47.561 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*10*13##`
2024-04-16 20:09:13.320 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` was successfully queued.
2024-04-16 20:09:13.329 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Command session connection reset, retrying...
2024-04-16 20:09:13.330 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Opening command session.
2024-04-16 20:09:13.334 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Negotiating command session.
2024-04-16 20:09:13.339 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Received SHA challenge: `*98*2##`
2024-04-16 20:09:13.339 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Accepting sha256 challenge, initiating handshake.
2024-04-16 20:09:13.342 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Sending command session password.
2024-04-16 20:09:13.511 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` received response `*#18*51*51*584395##`.
2024-04-16 20:09:13.555 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` was successfully sent.
2024-04-16 20:10:13.321 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` was successfully queued.
2024-04-16 20:10:13.330 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Command session connection reset, retrying...
2

without any parsing of the value.

I notice though that the message response for total energy consumption does change overtime, so the sensor and the gateway are responding with up to date values.

2024-04-16 20:10:13.512 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` received response `*#18*51*51*584395##`.
 and after a while
2024-04-16 20:32:13.532 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message `*#18*51*51##` received response `*#18*51*51*584948##`.

Tho the UI does not report any change, I guess because it is not parsed and updated by the integration.

Lastly, I noticed that when the integration gets stuck I do not get any more acknowledgement from the gateway of messages being received, such as

2024-04-16 00:07:12.465 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*0*08##`

I might be on to something.

When I turn on a regular light, I get three events, in order:

event_type: myhome_message_event
data:
  gateway: 10.0.5.2
  message: "*1*1000#0*09##"
  family: Command translation
  type: Status
  who: 1
  where: "09"
  what: 1000
  what parameters:
    - "0"
origin: LOCAL
time_fired: "2024-04-18T17:36:45.059288+00:00"
context:
  id: 01HVS4GG03Z60NT9PTT6R971TW
  parent_id: null
  user_id: null
event_type: myhome_message_event
data:
  gateway: 10.0.5.2
  message: "*1*0*09##"
  family: Event
  type: Status
  who: 1
  where: "09"
origin: LOCAL
time_fired: "2024-04-18T17:36:45.132662+00:00"
context:
  id: 01HVS4GG2CBSCJ9T7TSA5M55Q2
  parent_id: null
  user_id: null
event_type: state_changed
data:
  entity_id: light.terrazza_piccola
  old_state:
    entity_id: light.terrazza_piccola
    state: "on"
    attributes:
      supported_color_modes:
        - onoff
      color_mode: onoff
      A: "0"
      PL: "9"
      friendly_name: Small Terrace
      supported_features: 8
    last_changed: "2024-04-18T17:36:43.909439+00:00"
    last_reported: "2024-04-18T17:36:43.909439+00:00"
    last_updated: "2024-04-18T17:36:43.909439+00:00"
    context:
      id: 01HVS4GEW5FAY2PA7RATTA80R8
      parent_id: null
      user_id: null
  new_state:
    entity_id: light.terrazza_piccola
    state: "off"
    attributes:
      supported_color_modes:
        - onoff
      color_mode: null
      A: "0"
      PL: "9"
      friendly_name: Small Terrace
      supported_features: 8
    last_changed: "2024-04-18T17:36:45.133549+00:00"
    last_reported: "2024-04-18T17:36:45.133549+00:00"
    last_updated: "2024-04-18T17:36:45.133549+00:00"
    context:
      id: 01HVS4GG2DF1RGCS1S369ESH9S
      parent_id: null
      user_id: null
origin: LOCAL
time_fired: "2024-04-18T17:36:45.133549+00:00"
context:
  id: 01HVS4GG2DF1RGCS1S369ESH9S
  parent_id: null
  user_id: null

Which I assume is the event for the light switch and its translation by the integration.

If I do so with a dimmable light

event_type: myhome_message_event
data:
  gateway: 10.0.5.2
  message: "*1*1000#1*13##"
  family: Command translation
  type: Status
  who: 1
  where: "13"
  what: 1000
  what parameters:
    - "1"
origin: LOCAL
time_fired: "2024-04-18T17:43:57.886245+00:00"
context:
  id: 01HVS4XPNYXGDDY547AHBRF42R
  parent_id: null
  user_id: null
event_type: myhome_message_event
data:
  gateway: 10.0.5.2
  message: "*1*10*13##"
  family: Event
  type: Status
  who: 1
  where: "13"
  what: 10
origin: LOCAL
time_fired: "2024-04-18T17:43:57.925931+00:00"
context:
  id: 01HVS4XPQ50MGF8THJPXBWKRJ6
  parent_id: null
  user_id: null
2024-04-18 19:43:57.886 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*1000#1*13##`
2024-04-18 19:43:57.886 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Ignoring translation message `*1*1000#1*13##`
2024-04-18 19:43:57.925 DEBUG (MainThread) [custom_components.myhome] CHIPOTLE
2024-04-18 19:43:57.925 DEBUG (MainThread) [custom_components.myhome] [F454 gateway - 10.0.5.2] Message received: `*1*10*13##`
2024-04-18 19:43:57.937 ERROR (MainThread) [custom_components.myhome] Traceback (most recent call last):
File "/config/custom_components/myhome/gateway.py", line 264, in listening_loop
self.hass.data[DOMAIN][self.mac][CONF_PLATFORMS][LIGHT][message.entity][CONF_ENTITIES][LIGHT],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: '1-13'

Could it be due to the dimmable light message format?

I use a DALI dimmer, could that be the cause?

Turns out, a light in my home was not mapped in the configuration of this integration, and interacting with it would cause a message to look up an entity in a dictionary, not finding it and breaking.

At least that’s how I’ve understood it so far.

Hi all I am considering to use for production this integration (I have a F454 as gateway and a large systems with around 100 devices) but reading this thread it seems is really unstable (many users complaining it get stuck every few times per day → need to restart HA)

but what also worries me is that there is basically no answer from the developers for several weeks, so basically no help/support.

Why this integration is not officially part of HA?

Also there is no automatic discovery of devices and everything must to be configured via yaml files.

So I am looking for suggestion and maybe experience with alternatives?

Sdomotica_Automation](/u/Sdomotica_Automation)

1m

For biggest systems I suggest mine solution Sdomotica

but is it based on the same integration by anotherjulien ?

No, it’s totally differente and works from 10 years more or less.
Also Julien refers to me for professional use

Send me PM for more info.

I have the same problem, someone has a solution?

Thanks

Same problem have you been able to solve it?

thanks

Yes after a while I was able to solve it.
It was due to dimmer that were not defined in the configuration file, so each time I physically pressed a button to act on a dimmer, the integration crashed.

I’ve solved it by updating the gateway.py file of the integration.
line 260, I changed “if isinstance(” to “if message.entity in self.hass.data[DOMAIN][self.mac][CONF_PLATFORMS][LIGHT] and isinstance(”

I will try to create a pull request on github for this.

Hope this will help.

Hello @anotherjulien
I have a 300EOS as bticino gateway and I have a KG4691 module to control temperature and humidity in my home.
Humidity value is hidden by bticino.
Is it possible to use this integration to show the humidity value in real time?

Do I need OpenWebNet daemon too? I really don’t have idea about how to install it on HA…
Thanks in advance…

300Eos not permit third parties software connection

Hey,

I am trying to integrate my MyHomeServer1 into HA. So far I managed to add all lights and all shutters that are in Automation Area 0 of the system, but anything with a four digit “where” code is simply not recognized.

Here is an example:

    hallway_up: 
      where: '02' #<- works / A: 0 PL: 2
      name: Hallway Up
      dimmable: False
    test3: 
      where: '0102' #<- does not work / A: 1 PL: 2
      name: Test 3
      dimmable: False

both are lights in the same room.

image

as you see, it’s not recognized properly and pressing the two on/off buttons does nothing.

Any help is much appreciated, thank you!

I have installed the latest version of HA and the latest of the Myhome integration, but my HomeServer is not recognized by default.
When manually running the ownd command, it can see the commands:

python -m OWNd -v 2 -a 192.168.1.119 -p 20000 -P XXXXXX
2024-06-28 13:22:00,227 - OWNd - INFO - Starting OWNd.
2024-06-28 13:22:00,228 - OWNd - DEBUG - [Unknown model gateway - 192.168.1.119] Opening event session.
2024-06-28 13:22:00,231 - OWNd - DEBUG - [Unknown model gateway - 192.168.1.119] Negotiating event session.
2024-06-28 13:22:00,283 - OWNd - DEBUG - [Unknown model gateway - 192.168.1.119] Received SHA challenge: `*98*2##`
2024-06-28 13:22:00,283 - OWNd - DEBUG - [Unknown model gateway - 192.168.1.119] Accepting sha256 challenge, initiating handshake.
2024-06-28 13:22:00,287 - OWNd - DEBUG - [Unknown model gateway - 192.168.1.119] Sending event session password.




2024-06-28 13:22:09,233 - OWNd - DEBUG - Received: *1*1000#1*0211##
2024-06-28 13:22:09,281 - OWNd - DEBUG - Received: *1*1*0211##
2024-06-28 13:22:09,281 - OWNd - INFO - Light 0211 is switched on.
2024-06-28 13:22:10,288 - OWNd - DEBUG - Received: *1*1000#0*0211##
2024-06-28 13:22:10,308 - OWNd - DEBUG - Received: *1*0*0211##
2024-06-28 13:22:10,308 - OWNd - INFO - Light 0211 is switched off.
^C2024-06-28 13:23:05,896 - OWNd - INFO - Stoping OWNd.
2024-06-28 13:23:05,896 - OWNd - DEBUG - [Unknown model gateway - 192.168.1.119] Event session closed.
2024-06-28 13:23:05,896 - OWNd - INFO - OWNd stopped.
db96d82f01ce:/config#

After manual configuration, I can see in the logs I keep getting errors. Log below.

2024-06-28 15:41:36 2024-06-28 13:41:36.673 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-06-28 15:41:36 2024-06-28 13:41:36.685 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration myhome which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-06-28 15:41:39 2024-06-28 13:41:39.189 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-06-28 15:41:39 2024-06-28 13:41:39.248 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-06-28 15:42:29 2024-06-28 13:42:29.423 WARNING (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.119] Connection requires a password but none was provided.
2024-06-28 15:42:35 2024-06-28 13:42:35.188 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry MyHomeServer1 Gateway for myhome
2024-06-28 15:42:35 Traceback (most recent call last):
2024-06-28 15:42:35   File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 272, in __call__
2024-06-28 15:42:35     return self._compiled([], data)
2024-06-28 15:42:35            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-28 15:42:35   File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 561, in validate_dict
2024-06-28 15:42:35     raise er.DictInvalid('expected a dictionary', path)
2024-06-28 15:42:35 voluptuous.error.DictInvalid: expected a dictionary
2024-06-28 15:42:35 
2024-06-28 15:42:35 During handling of the above exception, another exception occurred:
2024-06-28 15:42:35 
2024-06-28 15:42:35 Traceback (most recent call last):
2024-06-28 15:42:35   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
2024-06-28 15:42:35     result = await component.async_setup_entry(hass, self)
2024-06-28 15:42:35              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-28 15:42:35   File "/config/custom_components/myhome/__init__.py", line 62, in async_setup_entry
2024-06-28 15:42:35     _validated_config = config_schema(yaml.safe_load(await yaml_file.read()))
2024-06-28 15:42:35                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-28 15:42:35   File "/config/custom_components/myhome/validate.py", line 177, in __call__
2024-06-28 15:42:35     data = super().__call__(data)
2024-06-28 15:42:35            ^^^^^^^^^^^^^^^^^^^^^^
2024-06-28 15:42:35   File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 276, in __call__
2024-06-28 15:42:35     raise er.MultipleInvalid([e])
2024-06-28 15:42:35 voluptuous.error.MultipleInvalid: expected a dictionary

Any idea what is the underlying issue?

***** UPDATE *****
Reinstalled and now it’s working… No clue about the actual root cause

Ok, so, is there any way to show the humidity value on HA?

Yes it’s possibile, but not troght 300EOS. I know how do it with mine addon but not with the Aurielen component

Hi @anotherjulien, thanks for the great integration!

I managed to set up most of my MyHome devices, except for the alarm, which is a 3485STD connected to the MH200N.

I found out (mentioned at the openwebnet-alarm script on GitHub) it is possible to enable / disable the alarm with OpenWebNet messages thanks to a little trick.

In the central unit menu of the alarm you need to make two automations (command → opencode see 6.7 in the central unit manual: https://assets.legrand.com/pim/NP-FT-GT/RA00100AG_I_EN.pdf), otherwise you can’t enable / disable the alarm remotely:

Enable Alarm
*9*6*9## -> *5*8##
Disable Alarm
*9*7*9## -> *5*9##

Make sure remote control is active by setting remote management / telecontrol to USER or ON (see 8.8 and 7.5 in the manual).

Now I can enable / disable the alarm from Home Assistant with the messages *9*6*9## and *9*7*9##

Also great is, now it should also be possible to send a message that starts an extra automation that enables only certain zones (see 8.8 in the manual).

Enable Zone 1 2 3
*9*8*9## -> *5*8#123##

Perfect if you want to have an armed_away (all zones enabled *9*6*9##) and armed_home status (only zones downstairs enabled *9*8*9##).

Here I enabled the alarm:

It’s possible to get the status of the alarm with *#5*0## (1.3.1.3. in WHO_5.pdf on the Legrand site)

I haven’t figured out how to receive and analyse the messages or even on how to send a message outside the developer tools / services so it’s still a bit difficult to move forward from here.

Ideally I get the armed_away and armed_home states (from the Manual Control Alarm control panel) working with different zones.

Would the next step be to create some sort of virtual device / devices in Node Red that use the above commands? Perhaps the first step would be to send and send / receive OpenWebNet messages in Node Red (or maybe not in Node Red), is that possible? Any ideas?

I read you previously stated the Alarm (WHO 5) did not have any real value since there was so little you could do with it.
Would it be possible to implement some alarm functionality in your integration based on the above information?

Hi Sandro. I’m interested on how to get humidity from KG4691 with MyHomeServer1. I can see the attribute if I use @anotherjulien integration but not with SDomotica.
Thanks

Hello @anotherjulien
I have already connected all my bticino Myhomeserver1, lights, thermometers and shutters with your integration and I thank you very much.
I would connect also my alarm (the new bticino 4201c), has the alarm discussion continued? Do you have any new information?
Thanks.