Skip to content

Commit

Permalink
Merge pull request #44 from jipem01/add_early_linky
Browse files Browse the repository at this point in the history
Add early linky (G1 pilote)
  • Loading branch information
hekmon authored Nov 14, 2024
2 parents 9f57992 + ef97941 commit 684bf75
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/linkytic/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@
"62": "Compteur monophasé 90 A généralisation Linky G1 - arrivée puissance basse",
"63": "Compteur triphasé 60 A généralisation Linky G1 - arrivée puissance basse",
"64": "Compteur monophasé 60 A généralisation Linky G3 - arrivée puissance basse",
"65": "Compteur monophasé 90A LINKY expérimentation CPL G3",
"66": "Module du compteur modulaire généralisation",
"67": "Compteur monophasé 90A LINKY - pilote G1 - arrivée basse",
"68": "Compteur triphasé 60A LINKY - pilote G1 - arrivée basse",
"70": "Compteur monophasé Linky 60 A mise au point G3",
"71": "Compteur triphasé Linky 60 A mise au point G3",
"75": "Compteur monophasé 90 A généralisation Linky G3 - arrivée puissance basse",
Expand Down
63 changes: 63 additions & 0 deletions custom_components/linkytic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,69 @@ async def async_setup_entry(
field=StatusRegister.POINTE_MOBILE,
),
]
# Handle protocol deviation for experimental/pilote modules
if (serial_reader.device_identification[DID_TYPE_CODE]=="67"):
sensors.append(
ApparentPowerSensor(
tag="SINST1",
name="Puissance app. instantanée soutirée",
config_title=config_entry.title,
config_uniq_id=config_entry.entry_id,
serial_reader=serial_reader,
register_callback=True,
)
)
sensors.append(
ApparentPowerSensor(
tag="SMAXN",
name="Puissance app. max. soutirée n",
config_title=config_entry.title,
config_uniq_id=config_entry.entry_id,
serial_reader=serial_reader,
register_callback=True,
)
)
sensors.append(
ApparentPowerSensor(
tag="SMAXN-1",
name="Puissance app. max. soutirée n-1",
config_title=config_entry.title,
config_uniq_id=config_entry.entry_id,
serial_reader=serial_reader,
register_callback=True,
)
)
else:
sensors.append(
ApparentPowerSensor(
tag="SINSTS",
name="Puissance app. instantanée soutirée",
config_title=config_entry.title,
config_uniq_id=config_entry.entry_id,
serial_reader=serial_reader,
register_callback=True,
)
)
sensors.append(
ApparentPowerSensor(
tag="SMAXSN",
name="Puissance app. max. soutirée n",
config_title=config_entry.title,
config_uniq_id=config_entry.entry_id,
serial_reader=serial_reader,
register_callback=True,
)
)
sensors.append(
ApparentPowerSensor(
tag="SMAXSN-1",
name="Puissance app. max. soutirée n-1",
config_title=config_entry.title,
config_uniq_id=config_entry.entry_id,
serial_reader=serial_reader,
register_callback=True,
)
)
# Add producer specific sensors
if bool(config_entry.data.get(SETUP_PRODUCER)):
sensors.append(
Expand Down

0 comments on commit 684bf75

Please sign in to comment.