msunpv package

msunpv library.

class msunpv.MSunPVWebConnect(session, ip)[source]

Bases: object

Class to connect to the MSunPV webconnect module and read status.xml.

Init MSunPV connection.

Parameters:
  • session (ClientSession) – aiohttp client session

  • ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

__init__(session, ip)[source]

Init MSunPV connection.

Parameters:
  • session (ClientSession) – aiohttp client session

  • ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

async get_status()[source]

Get Status from MSunPV. Call HTTP URL: http://<IP_HOSTNAME>/status.xml

Args:

Raises:

MSunPVXMLDataException – XML data not valid from status.xml.

Returns:

class MSunPVDataIndex

Return type:

MSunPVDataIndex

async get_index()[source]

Get Index from MSunPV. Call HTTP URL: http://<IP_HOSTNAME>/index.xml

Args:

Raises:

MSunPVXMLDataException – XML data not valid from index.xml.

Returns:

class MSunPVDataIndex

Return type:

MSunPVDataIndex

async refresh(data_type='status.xml')[source]

Get Index or Status from MSunPV.

Parameters:

data_type (str) – status.xml (default) or index.xml

Return type:

bool

Raises:

Returns:

class MSunPVDataIndex

Return type:

MSunPVDataIndex

Parameters:

data_type (str)

exception msunpv.MSunPVException[source]

Bases: Exception

Base exception of the msunpv library.

exception msunpv.MSunPVConnectionException[source]

Bases: MSunPVException

An error occurred in the connection with the device.

exception msunpv.MSunPVXMLDataException[source]

Bases: MSunPVException

XML Data Exception

class msunpv.MSunPVDataIndex(data_xml)[source]

Bases: MSunPVCommon

Class to store MSunPV Index data to JSON.

Init MSunPVDataIndex.

Parameters:

data_xml (str) – data retry

Raises:

__init__(data_xml)[source]

Init MSunPVDataIndex.

Parameters:

data_xml (str) – data retry

Return type:

None

Raises:

time: str

Time 16:03:53

date: str

Date 05/06/2025

sd_save: str

SD recording On/Off On

sd_delay: str

Recording interval on SD - minutes and seconds 01:00

modele: str

Router model MS_PV2_2d or MS_PV4_4d MS_PV2_2d

version: str

Project version 5.0.1

serial_number: str

Serial number 0000224

firmware_wifi: str

Firmware Wifi 105b

firmware_router: str

Firmware Router 105b

typans: list[str]

Type sensors PowRéso;1;6:PowP.V;1;6:OutBal;0;3:OutRad;0;3:VoltRés;1;4:T_Bal1;1;18:T_SDB;1;18:T_Amb;1;18:S9;0;0:S10;0;0:S11;0;0:S12;0;0:S13;0;0:S14;0;0:S15;0;0:S16;0;0:

typouts: list[str]

Type Output R_Bal1;0;2:Rad_SDB;0;2:A3;0;0:A4;0;0:A5;0;0:A6;0;0:A7;0;0:A8;0;0:A9;0;0:A10;0;0:A11;0;0:A12;0;0:A13;0;0:A14;0;0:A15;0;0:A16;0;0:

cmdm: list[str]

Command

typcpt: list[str]

Type compteur

sensor_type_info(id=0)[source]

Sensor information type

Parameters:

id (int) – id (default 0)

Return type:

SensorType

Raises:

Returns:

Sensor information

Return type:

SensorType

Parameters:

id (int)

counter_type_info(id=0)[source]

Counter information type

Parameters:

id (int) – id (default 0)

Return type:

CounterType

Raises:

Returns:

Counter information

Return type:

CounterType

Parameters:

id (int)

output_type_txt(id=0)[source]

Output text

Parameters:

id (int) – id (default 0)

Return type:

str

Raises:

Returns:

text

Return type:

str

Parameters:

id (int)

command_info(id=0)[source]

Command information

Parameters:

id (int) – id (default 0)

Return type:

Command

Raises:

Returns:

Command

Parameters:

id (int)

Return type:

Command

class msunpv.MSunPVDataStatus(data_xml)[source]

Bases: MSunPVCommon

Class to store MSunPV Status data to JSON.

Init MSunPVDataStatus.

Parameters:

data_xml (str) – data retry

Raises:

state_test_router_hight: bool

State test router hight True/False False

choutval: list[str]

Values calculated at the output of the heating modules 0;0;0;ff;:0,0;0,0;0,0;0,0;

__init__(data_xml)[source]

Init MSunPVDataStatus.

Parameters:

data_xml (str) – data retry

Return type:

None

Raises:

clock: str

Time and Day (on two characters in French) 16:03:53 ME

rssi_value: int = 0

Wifi Received Signal Strength Indication value in % [0 to 100] 40

rssi_quality: int = 0

Wifi Received Signal Strength Indication in dbm [-100 dBm (weak signal) to 0 dBm (strong signal)] -80

time: str

Time 16:03:53

date: str

Date 05/06/2025

sd_save: str

SD recording On/Off On

sd_delay: str

Recording interval on SD - minutes and seconds 01:00

modele: str

Router model MS_PV2_2d or MS_PV4_4d MS_PV2_2d

version: str

Project version 5.0.1

serial_number: str

Serial number 0000224

firmware_wifi: str

Firmware Wifi 105b

firmware_router: str

Firmware Router 105b

power_reso: float

Power reso (EDF/ENEDIS/Other) in W -49,6 injection or 49,6 consumers

power_pv_read: float

power solar panel in W -0,6

power_pv_positive: float

power solar panel in W - positive 0,6

out_balloon: float

Output Balloon

  • MSPV_2_2d – (0–400) → (0–100%) %, value 5

  • MSPV_4_4d – Power en W, value 20

out_radiator: float

Output Radiator

  • MSPV_2_2d – (0–400) → (0–100%) %, value 10

  • MSPV_4_4d – Power en W, value 200

temperature_balloon: float

Temperature Balloon in °C 47

temperature_radiator: float

Temperature radiator in °C 19

temperature_room: float

Temperature room in °C 21

sensor_8: float = 0

Sensor 9 0

sensor_9: float = 0

Sensor 10 0

sensor_10: float = 0

Sensor 11 0

sensor_11: float = 0

Sensor 12 0

sensor_12: float = 0

Sensor 13 0

sensor_13: float = 0

Sensor 14 0

sensor_14: float = 0

Sensor 15 0

sensor_15: float = 0

Sensor 16 0

power_home: float

Power home consumption in W 49

power_pv_inject: float

power solar panel injected in W 49

power_pv_consumed: float

power solar panel consumed in W 49

survmm: list[int]

Sensor monitoring 0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;

  • 0 - no overflow

  • 1 - maximum

  • 2 - minimum overflow, or sensor disconnected.

cmdpos: list[str]

Position of the 8 commands 2;0;0;0;0;0;0;2;

cmd_balloon_manuel: bool

Command balloon manuel True/False False

cmd_balloon_auto: bool

Command balloon auto True/False True

cmd_radiator_manuel: bool

Command radiator manuel True/False False

cmd_radiator_auto: bool

Command radiator auto True/False True

state_test_router_inject: bool

State test router injection True/False False

state_test_router_zero: bool

State test router zero True/False False

state_test_router_medium: bool

State test router medium True/False False

outstat: list[int]

Values of the 16 outputs (0–100%) in % 17;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;

daily_consumption: float

Daily consumption in kWh 2

daily_injection: float

Daily injectionin kWh 1

daily_production: float

Daily production in kWh 2

cumulative_production: float

Cumulative production in kWh 258

daily_balloon_consumption: float

Daily water heater consumption (Msunpv 4x4) in kWh 1

daily_radiator_consumption: float

Daily radiator consumption (Msunpv 4x4) in kWh 1

production_daily_consumption: float

Solar production consumed (PV - injection) in kWh 1

total_consumption: float

Total consumption (grid + PV - injection) in kWh 7

cptvals: list[str]

Values of the 8 counters in hexadecimal 9a02;ffffa128;ffffff69;ffffa560;0;0;0;0;

class msunpv.SensorType[source]

Bases: GenericType

Same structure as GenericType

name: str
dotpos: int
type: int
suffix: str
class msunpv.CounterType[source]

Bases: GenericType

Same structure as GenericType

name: str
dotpos: int
type: int
suffix: str
class msunpv.Command[source]

Bases: TypedDict

cmdtype: int

Command Type

cmdvalue: int

Command Value

cmdtxt: str

Command Text label

param1: str

Command parameter 1

param2: str

Command parameter 2

param3: str

Command parameter 3

param4: str

Command parameter 4

class msunpv.MSunPVRead(ip)[source]

Bases: object

Class to Read the MSunPV using webconnect module.

Init MSunPVRead reader class.

Parameters:

ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

__init__(ip)[source]

Init MSunPVRead reader class.

Parameters:

ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

last_read_td: float

Last read MSunPV status.xml

last_read_ti: float

Last read MSunPV index.xml

DataMSunPVDataStatus: MSunPVDataStatus

Data from MSunPV status.xml

DataMSunPVDataIndex: MSunPVDataIndex

Data from MSunPV index.xml

async start()[source]

Initializes the HTTP session and the MSunPVWebConnect object.

Args:

Raises:

MSunPVConnectionException – Hostname or IP address empty

async stop()[source]

Properly closes the HTTP session.

Args:

Raises:

async refresh_data(All=False)[source]

Reads data from WebConnect once. Read MSunPV data from status.xml and index.xml and update local variables:

  • MSunPVDataStatus

  • MSunPVDataIndex

Parameters:

All (bool) – Rafresh All data (status.xml and index.xml) (Default: False)

Raises:

MSunPVXMLDataException – Message

async wait_for(seconds)[source]

Number of seconds to wait since the last status.xml call.

Parameters:

seconds (float) – number of seconds.

Raises:

Submodules

msunpv.const module

Constants for MSunPV WebConnect library for Python.

msunpv.const.DEFAULT_TIMEOUT = 15

Default time out 15s

msunpv.data module

Data for the MSunPV library.

class msunpv.data.GenericType[source]

Bases: TypedDict

Generic Type for Sensor and Counter

name: str

Name

dotpos: int

N/A

type: int

Type of Sensor Or Counter (MsunPV internal type)

suffix: str

suffix or unit

class msunpv.data.SensorType[source]

Bases: GenericType

Same structure as GenericType

name: str
dotpos: int
type: int
suffix: str
class msunpv.data.CounterType[source]

Bases: GenericType

Same structure as GenericType

name: str
dotpos: int
type: int
suffix: str
class msunpv.data.Command[source]

Bases: TypedDict

cmdtype: int

Command Type

cmdvalue: int

Command Value

cmdtxt: str

Command Text label

param1: str

Command parameter 1

param2: str

Command parameter 2

param3: str

Command parameter 3

param4: str

Command parameter 4

class msunpv.data.MSunPVCommon[source]

Bases: object

Generic Class function used in MSunPVDataStatus and MSunPVDataIndex

get(attribute)[source]

Returns the value of an attribute if it exists, otherwise None.

Parameters:

attribute (str) – name of attribute (in lower case)

Return type:

Any

Raises:

Returns:

None or value of attribute

Return type:

Any

Parameters:

attribute (str)

class msunpv.data.MSunPVDataStatus(data_xml)[source]

Bases: MSunPVCommon

Class to store MSunPV Status data to JSON.

Init MSunPVDataStatus.

Parameters:

data_xml (str) – data retry

Raises:

state_test_router_hight: bool

State test router hight True/False False

choutval: list[str]

Values calculated at the output of the heating modules 0;0;0;ff;:0,0;0,0;0,0;0,0;

__init__(data_xml)[source]

Init MSunPVDataStatus.

Parameters:

data_xml (str) – data retry

Return type:

None

Raises:

clock: str

Time and Day (on two characters in French) 16:03:53 ME

rssi_value: int = 0

Wifi Received Signal Strength Indication value in % [0 to 100] 40

rssi_quality: int = 0

Wifi Received Signal Strength Indication in dbm [-100 dBm (weak signal) to 0 dBm (strong signal)] -80

time: str

Time 16:03:53

date: str

Date 05/06/2025

sd_save: str

SD recording On/Off On

sd_delay: str

Recording interval on SD - minutes and seconds 01:00

modele: str

Router model MS_PV2_2d or MS_PV4_4d MS_PV2_2d

version: str

Project version 5.0.1

serial_number: str

Serial number 0000224

firmware_wifi: str

Firmware Wifi 105b

firmware_router: str

Firmware Router 105b

power_reso: float

Power reso (EDF/ENEDIS/Other) in W -49,6 injection or 49,6 consumers

power_pv_read: float

power solar panel in W -0,6

power_pv_positive: float

power solar panel in W - positive 0,6

out_balloon: float

Output Balloon

  • MSPV_2_2d – (0–400) → (0–100%) %, value 5

  • MSPV_4_4d – Power en W, value 20

out_radiator: float

Output Radiator

  • MSPV_2_2d – (0–400) → (0–100%) %, value 10

  • MSPV_4_4d – Power en W, value 200

temperature_balloon: float

Temperature Balloon in °C 47

temperature_radiator: float

Temperature radiator in °C 19

temperature_room: float

Temperature room in °C 21

sensor_8: float = 0

Sensor 9 0

sensor_9: float = 0

Sensor 10 0

sensor_10: float = 0

Sensor 11 0

sensor_11: float = 0

Sensor 12 0

sensor_12: float = 0

Sensor 13 0

sensor_13: float = 0

Sensor 14 0

sensor_14: float = 0

Sensor 15 0

sensor_15: float = 0

Sensor 16 0

power_home: float

Power home consumption in W 49

power_pv_inject: float

power solar panel injected in W 49

power_pv_consumed: float

power solar panel consumed in W 49

survmm: list[int]

Sensor monitoring 0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;

  • 0 - no overflow

  • 1 - maximum

  • 2 - minimum overflow, or sensor disconnected.

cmdpos: list[str]

Position of the 8 commands 2;0;0;0;0;0;0;2;

cmd_balloon_manuel: bool

Command balloon manuel True/False False

cmd_balloon_auto: bool

Command balloon auto True/False True

cmd_radiator_manuel: bool

Command radiator manuel True/False False

cmd_radiator_auto: bool

Command radiator auto True/False True

state_test_router_inject: bool

State test router injection True/False False

state_test_router_zero: bool

State test router zero True/False False

state_test_router_medium: bool

State test router medium True/False False

outstat: list[int]

Values of the 16 outputs (0–100%) in % 17;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;

daily_consumption: float

Daily consumption in kWh 2

daily_injection: float

Daily injectionin kWh 1

daily_production: float

Daily production in kWh 2

cumulative_production: float

Cumulative production in kWh 258

daily_balloon_consumption: float

Daily water heater consumption (Msunpv 4x4) in kWh 1

daily_radiator_consumption: float

Daily radiator consumption (Msunpv 4x4) in kWh 1

production_daily_consumption: float

Solar production consumed (PV - injection) in kWh 1

total_consumption: float

Total consumption (grid + PV - injection) in kWh 7

cptvals: list[str]

Values of the 8 counters in hexadecimal 9a02;ffffa128;ffffff69;ffffa560;0;0;0;0;

class msunpv.data.MSunPVDataIndex(data_xml)[source]

Bases: MSunPVCommon

Class to store MSunPV Index data to JSON.

Init MSunPVDataIndex.

Parameters:

data_xml (str) – data retry

Raises:

__init__(data_xml)[source]

Init MSunPVDataIndex.

Parameters:

data_xml (str) – data retry

Return type:

None

Raises:

time: str

Time 16:03:53

date: str

Date 05/06/2025

sd_save: str

SD recording On/Off On

sd_delay: str

Recording interval on SD - minutes and seconds 01:00

modele: str

Router model MS_PV2_2d or MS_PV4_4d MS_PV2_2d

version: str

Project version 5.0.1

serial_number: str

Serial number 0000224

firmware_wifi: str

Firmware Wifi 105b

firmware_router: str

Firmware Router 105b

typans: list[str]

Type sensors PowRéso;1;6:PowP.V;1;6:OutBal;0;3:OutRad;0;3:VoltRés;1;4:T_Bal1;1;18:T_SDB;1;18:T_Amb;1;18:S9;0;0:S10;0;0:S11;0;0:S12;0;0:S13;0;0:S14;0;0:S15;0;0:S16;0;0:

typouts: list[str]

Type Output R_Bal1;0;2:Rad_SDB;0;2:A3;0;0:A4;0;0:A5;0;0:A6;0;0:A7;0;0:A8;0;0:A9;0;0:A10;0;0:A11;0;0:A12;0;0:A13;0;0:A14;0;0:A15;0;0:A16;0;0:

cmdm: list[str]

Command

typcpt: list[str]

Type compteur

sensor_type_info(id=0)[source]

Sensor information type

Parameters:

id (int) – id (default 0)

Return type:

SensorType

Raises:

Returns:

Sensor information

Return type:

SensorType

Parameters:

id (int)

counter_type_info(id=0)[source]

Counter information type

Parameters:

id (int) – id (default 0)

Return type:

CounterType

Raises:

Returns:

Counter information

Return type:

CounterType

Parameters:

id (int)

output_type_txt(id=0)[source]

Output text

Parameters:

id (int) – id (default 0)

Return type:

str

Raises:

Returns:

text

Return type:

str

Parameters:

id (int)

command_info(id=0)[source]

Command information

Parameters:

id (int) – id (default 0)

Return type:

Command

Raises:

Returns:

Command

Parameters:

id (int)

Return type:

Command

msunpv.exceptions module

Exceptions for the MSunPV library.

exception msunpv.exceptions.MSunPVException[source]

Bases: Exception

Base exception of the msunpv library.

exception msunpv.exceptions.MSunPVConnectionException[source]

Bases: MSunPVException

An error occurred in the connection with the device.

exception msunpv.exceptions.MSunPVXMLDataException[source]

Bases: MSunPVException

XML Data Exception

msunpv.read module

MSunPV Read library for Python.

See: https://ard-tek.com/

Source: https://github.com/thanatos-vf-2000/msunpv

Init MSunPV connection.

Args:

ip (str): Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

KeyError: Hostname or IP address empty

class msunpv.read.MSunPVRead(ip)[source]

Bases: object

Class to Read the MSunPV using webconnect module.

Init MSunPVRead reader class.

Parameters:

ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

__init__(ip)[source]

Init MSunPVRead reader class.

Parameters:

ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

last_read_td: float

Last read MSunPV status.xml

last_read_ti: float

Last read MSunPV index.xml

DataMSunPVDataStatus: MSunPVDataStatus

Data from MSunPV status.xml

DataMSunPVDataIndex: MSunPVDataIndex

Data from MSunPV index.xml

async start()[source]

Initializes the HTTP session and the MSunPVWebConnect object.

Args:

Raises:

MSunPVConnectionException – Hostname or IP address empty

async stop()[source]

Properly closes the HTTP session.

Args:

Raises:

async refresh_data(All=False)[source]

Reads data from WebConnect once. Read MSunPV data from status.xml and index.xml and update local variables:

  • MSunPVDataStatus

  • MSunPVDataIndex

Parameters:

All (bool) – Rafresh All data (status.xml and index.xml) (Default: False)

Raises:

MSunPVXMLDataException – Message

async wait_for(seconds)[source]

Number of seconds to wait since the last status.xml call.

Parameters:

seconds (float) – number of seconds.

Raises:

msunpv.webconnect module

MSunPV WebConnect library for Python.

See: https://ard-tek.com/

Source: https://github.com/thanatos-vf-2000/msunpv

Init MSunPV connection.

Args:

session (ClientSession): aiohttp client session ip (str): Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

KeyError: Hostname or IP address empty

class msunpv.webconnect.MSunPVWebConnect(session, ip)[source]

Bases: object

Class to connect to the MSunPV webconnect module and read status.xml.

Init MSunPV connection.

Parameters:
  • session (ClientSession) – aiohttp client session

  • ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

__init__(session, ip)[source]

Init MSunPV connection.

Parameters:
  • session (ClientSession) – aiohttp client session

  • ip (str) – Hostname or IP address of MSunPV 2*2 or 4*4

Raises:

MSunPVConnectionException – Hostname or IP address empty

async get_status()[source]

Get Status from MSunPV. Call HTTP URL: http://<IP_HOSTNAME>/status.xml

Args:

Raises:

MSunPVXMLDataException – XML data not valid from status.xml.

Returns:

class MSunPVDataIndex

Return type:

MSunPVDataIndex

async get_index()[source]

Get Index from MSunPV. Call HTTP URL: http://<IP_HOSTNAME>/index.xml

Args:

Raises:

MSunPVXMLDataException – XML data not valid from index.xml.

Returns:

class MSunPVDataIndex

Return type:

MSunPVDataIndex

async refresh(data_type='status.xml')[source]

Get Index or Status from MSunPV.

Parameters:

data_type (str) – status.xml (default) or index.xml

Return type:

bool

Raises:

Returns:

class MSunPVDataIndex

Return type:

MSunPVDataIndex

Parameters:

data_type (str)