energomera_hass_mqtt.extra_sensors
Package to provide additional sensors on top of IecToHassSensor.
Classes
|
Represents a binary pseudo-sensor. |
|
Represents a pseudo-sensor, i.e. one doesn't exist on meter. |
- class energomera_hass_mqtt.extra_sensors.PseudoSensor(value, *args, **kwargs)
Bases:
IecToHassSensor,Generic[T]Represents a pseudo-sensor, i.e. one doesn’t exist on meter.
- property state_last_will_payload: str | None
Stores the value of the last will payload for the item, i.e. sent by the MQTT broker if the client disconnects uncleanly.
- Parameters:
value – Value for last will payload
- hass_config_payload()
Returns HASS config payload for the item.
- hass_gen_hass_sensor_props(idx)
Generates various properties for the HASS sensor (device and unique IDs, MQTT topic names etc.).
- Return type:
- hass_state_payload(value)
Returns HASS state payload for the item.
- property iec_item: List[DataSet]
Provides IEC entity associated with the instance.
- Returns:
IEC entity
- iec_try_value_by_index()
Attempts to pick an item from multi-valued meter’s response (if
response_idxis configured in the entry of parameters section being processed).- Return type:
- async process(setup_only=False)
Processes the entry received from the meter and sends it to HASS over MQTT.
- class energomera_hass_mqtt.extra_sensors.PseudoBinarySensor(value, *args, **kwargs)
Bases:
PseudoSensor[bool]Represents a binary pseudo-sensor.
- hass_config_payload()
Returns HASS config payload for the item.
- hass_gen_hass_sensor_props(idx)
Generates various properties for the HASS sensor (device and unique IDs, MQTT topic names etc.).
- Return type:
- hass_state_payload(value)
Returns HASS state payload for the item.
- property iec_item: List[DataSet]
Provides IEC entity associated with the instance.
- Returns:
IEC entity
- iec_try_value_by_index()
Attempts to pick an item from multi-valued meter’s response (if
response_idxis configured in the entry of parameters section being processed).- Return type:
- async process(setup_only=False)
Processes the entry received from the meter and sends it to HASS over MQTT.