Feature/v1.0.0 release (#12)

v1.0.0 - 2025-03-13
EHS-Sentinel has been heavily modified to incorporate the control mechanism
The read-in behavior of the modbus registers has been revised from chunks to single byte
MessageProcessor now runs asynchronously
MessageProducer added which takes over the writing communication with the WP
Configuration of HASS entities has moved from hardcoded to NASA Repository
NASA Repository has been fundamentally changed
All FSV Values, NASA_POWER, VAR_IN_TEMP_WATER_LAW_TARGET_F, NASA_INDOOR_OPMODE are allowed for writing mode
NASA_OUTDOOR_DEFROST_STEP DEFROST STEP 10 (b'0xa') added
ENUM_IN_SG_READY_MODE_STATE ACTIVE (b'0x2') added
New configuration point allowControl to allow control of the Samsung EHS heat pump (deactivated by default).
[!CAUTION]
This functionality requires that EHS-Sentinel actively communicates with the Samsung EHS, so EHS-Sentinel intervenes here in the Modbus data traffic between the components (it sends its own messages). The activation of this functionality is exclusively at your own risk. I assume no liability for any damage caused.

new configuration points in logging
controlMessage (default False) to print out the controlled mesagges
invalidPacket (default False) prints out invalid messages (length not ok, x34 not at end...)
Dashboard template has been split, ressources/dashboard_readonly_template.yaml is for readonly mode and the ressources/dashboard_controlmode_template.yaml for control mode
This commit is contained in:
echoDaveD
2025-03-13 19:57:33 +01:00
committed by GitHub
parent 43de00aacc
commit f0222d750f
26 changed files with 7251 additions and 4316 deletions

View File

@@ -2,48 +2,8 @@
class NASAMessage:
"""
A class to represent a NASA message.
Attributes
----------
packet_message : int
The message packet identifier.
packet_message_type : int
The type of the message packet.
packet_payload : bytes
The payload of the message packet in bytes.
Methods
-------
__str__():
Returns a string representation of the NASAMessage instance.
__repr__():
Returns a string representation of the NASAMessage instance.
"""
def __init__(self, packet_message=0x000, packet_message_type=0, packet_payload=[0]):
"""
Constructs all the necessary attributes for the NASAMessage object.
Parameters
----------
packet_message : int, optional
The message packet identifier (default is 0x000).
packet_message_type : int, optional
The type of the message packet (default is 0).
packet_payload : list, optional
The payload of the message packet as a list of integers (default is [0]).
"""
"""
Returns a string representation of the NASAMessage instance.
Returns
-------
str
A string representation of the NASAMessage instance.
"""
"""
Returns a string representation of the NASAMessage instance.
Returns
-------
str
A string representation of the NASAMessage instance.
"""
def __init__(self, packet_message=0x000, packet_message_type=0, packet_payload=[0]):
self.packet_message: int = packet_message
self.packet_message_type: int = packet_message_type
self.packet_payload: bytes = bytes([int(hex(x), 16) for x in packet_payload])
@@ -51,6 +11,7 @@ class NASAMessage:
def set_packet_message(self, value: int):
self.packet_message = value
self.packet_message_type = (value & 1536) >> 9
def set_packet_message_type(self, value: int):
self.packet_message_type = value
@@ -58,6 +19,9 @@ class NASAMessage:
def set_packet_payload(self, value: list):
self.packet_payload = bytes([int(hex(x), 16) for x in value])
def set_packet_payload_raw(self, value: bytes):
self.packet_payload = value
def to_raw(self) -> bytearray:
message_number_reconstructed = (self.packet_message_type << 9) | (self.packet_message & 0x1FF)
@@ -88,6 +52,12 @@ class NASAMessage:
(msgpayload >> 8) & 0xFF,
msgpayload & 0xFF
]
elif self.packet_message_type == 3:
return [
msg_rest_0,
msg_rest_1,
*[(msgpayload >> (8 * i)) & 0xFF for i in reversed(range(len(self.packet_payload)))]
]
def __str__(self):
return (