Legrand/Bticino MyHome

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…