Closed mmun closed 1 year ago
If I use your library directly via the python repl inside my Home Assistant container I'm able to confirm that it's able to connect and read the config correctly:
3fb51e04b575:/config# python -m asyncio
asyncio REPL 3.11.4 (main, Jun 22 2023, 23:15:05) [GCC 12.2.1 20220924] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from pyomnilogic_local.api import OmniLogicAPI
>>> omni_api = OmniLogicAPI('192.168.1.228', 10444, 10.0)
>>> omni_api
<pyomnilogic_local.api.OmniLogicAPI object at 0xf7135cf0>
>>> await omni_api.async_get_config()
MSPConfig(system=MSPSystem(omni_type=<OmniType.SYSTEM: 'System'>, vsp_speed_format='RPM', units='Standard'), backyard=MSPBackyard(system_id=0, name='Backyard', bow_id=None, omni_type=<OmniType.BACKYARD: 'Backyard'>, sensor=[MSPSensor(system_id=15, name='AirSensor', bow_id=None, omni_type=<OmniType.SENSOR: 'Sensor'>, type=<SensorType.AIR_TEMP: 'SENSOR_AIR_TEMP'>, units=<SensorUnits.FAHRENHEIT: 'UNITS_FAHRENHEIT'>)], bow=[MSPBoW(system_id=2, name='Pool', bow_id=2, omni_type=<OmniType.BOW: 'BodyOfWater'>, type=<BodyOfWaterType.POOL: 'BOW_POOL'>, filter=[MSPFilter(system_id=4, name='Filter Pump', bow_id=2, omni_type=<OmniType.FILTER: 'Filter'>, type=<FilterType.VARIABLE_SPEED: 'FMT_VARIABLE_SPEED_PUMP'>, max_percent=100, min_percent=18, max_rpm=3450, min_rpm=600, priming_enabled='yes', low_speed=18, medium_speed=50, high_speed=100)], relay=None, heater=MSPVirtualHeater(system_id=5, name=None, bow_id=2, omni_type=<OmniType.VIRT_HEATER: 'VirtualHeater'>, enabled='yes', set_point=87, solar_set_point=None, max_temp=104, min_temp=65, heater_equipment=[MSPHeaterEquip(system_id=6, name='Gas', bow_id=2, omni_type=<OmniType.HEATER_EQUIP: 'Heater-Equipment'>, type='PET_HEATER', heater_type=<HeaterType.GAS: 'HTR_GAS'>, enabled='yes', min_filter_speed=50, sensor_id=-1, supports_cooling=None)]), sensor=[MSPSensor(system_id=16, name='WaterSensor', bow_id=2, omni_type=<OmniType.SENSOR: 'Sensor'>, type=<SensorType.WATER_TEMP: 'SENSOR_WATER_TEMP'>, units=<SensorUnits.FAHRENHEIT: 'UNITS_FAHRENHEIT'>), MSPSensor(system_id=18, name='FlowSensor', bow_id=2, omni_type=<OmniType.SENSOR: 'Sensor'>, type=<SensorType.FLOW: 'SENSOR_FLOW'>, units=<SensorUnits.ACTIVE_INACTIVE: 'UNITS_ACTIVE_INACTIVE'>)], colorlogic_light=None, pump=[MSPPump(system_id=20, name='Suction', bow_id=2, omni_type=<OmniType.PUMP: 'Pump'>, type=<PumpType.VARIABLE_SPEED: 'PMP_VARIABLE_SPEED_PUMP'>, function=<PumpFunction.CLEANER_SUCTION: 'PMP_CLEANER_SUCTION'>, max_percent=100, min_percent=18, max_rpm=3450, min_rpm=600, priming_enabled='yes', low_speed=18, medium_speed=50, high_speed=100)], chlorinator=MSPChlorinator(system_id=7, name='Chlorinator', bow_id=2, omni_type=<OmniType.CHLORINATOR: 'Chlorinator'>, enabled='yes', timed_percent=50, superchlor_timeout=24, dispenser_type=<ChlorinatorDispenserType.SALT: 'SALT_DISPENSING'>, chlorinator_equipment=[MSPChlorinatorEquip(system_id=8, name='Chlorinator1', bow_id=2, omni_type=<OmniType.CHLORINATOR_EQUIP: 'Chlorinator-Equipment'>, enabled='yes')])), MSPBoW(system_id=3, name='Spa', bow_id=3, omni_type=<OmniType.BOW: 'BodyOfWater'>, type=<BodyOfWaterType.SPA: 'BOW_SPA'>, filter=[MSPFilter(system_id=10, name='Filter Pump', bow_id=3, omni_type=<OmniType.FILTER: 'Filter'>, type=<FilterType.VARIABLE_SPEED: 'FMT_VARIABLE_SPEED_PUMP'>, max_percent=100, min_percent=18, max_rpm=3450, min_rpm=600, priming_enabled='yes', low_speed=18, medium_speed=50, high_speed=100)], relay=None, heater=MSPVirtualHeater(system_id=11, name=None, bow_id=3, omni_type=<OmniType.VIRT_HEATER: 'VirtualHeater'>, enabled='no', set_point=92, solar_set_point=None, max_temp=104, min_temp=65, heater_equipment=[MSPHeaterEquip(system_id=12, name='Gas', bow_id=3, omni_type=<OmniType.HEATER_EQUIP: 'Heater-Equipment'>, type='PET_HEATER', heater_type=<HeaterType.GAS: 'HTR_GAS'>, enabled='yes', min_filter_speed=50, sensor_id=-1, supports_cooling=None)]), sensor=[MSPSensor(system_id=17, name='WaterSensor', bow_id=3, omni_type=<OmniType.SENSOR: 'Sensor'>, type=<SensorType.WATER_TEMP: 'SENSOR_WATER_TEMP'>, units=<SensorUnits.FAHRENHEIT: 'UNITS_FAHRENHEIT'>), MSPSensor(system_id=19, name='FlowSensor', bow_id=3, omni_type=<OmniType.SENSOR: 'Sensor'>, type=<SensorType.FLOW: 'SENSOR_FLOW'>, units=<SensorUnits.ACTIVE_INACTIVE: 'UNITS_ACTIVE_INACTIVE'>)], colorlogic_light=None, pump=None, chlorinator=MSPChlorinator(system_id=13, name='Chlorinator', bow_id=3, omni_type=<OmniType.CHLORINATOR: 'Chlorinator'>, enabled='yes', timed_percent=10, superchlor_timeout=24, dispenser_type=<ChlorinatorDispenserType.SALT: 'SALT_DISPENSING'>, chlorinator_equipment=[MSPChlorinatorEquip(system_id=14, name='Chlorinator1', bow_id=3, omni_type=<OmniType.CHLORINATOR_EQUIP: 'Chlorinator-Equipment'>, enabled='yes')]))], relay=None))
>>> print(await omni_api.async_get_telemetry(raw=True))
<?xml version="1.0" encoding="UTF-8" ?>
<STATUS version="1.5">
<Backyard systemId="0" statusVersion="5" airTemp="98" state="1" />
<BodyOfWater systemId="2" waterTemp="83" flow="1" />
<Filter systemId="4" filterState="1" filterSpeed="62" valvePosition="1" whyFilterIsOn="11" fpOverride="0" reportedFilterSpeed="62" power="376" lastSpeed="62" />
<VirtualHeater systemId="5" Current-Set-Point="87" enable="1" />
<Heater systemId="6" heaterState="1" temp="65535" enable="1" priority="0" maintainFor="24" />
<Chlorinator systemId="7" status="128" instantSaltLevel="2861" avgSaltLevel="3194" chlrAlert="0" chlrError="0" scMode="0" operatingState="2" Timed-Percent="50" operatingMode="1" />
<Pump systemId="20" pumpState="0" pumpSpeed="0" lastSpeed="100" whyOn="0" />
<BodyOfWater systemId="3" waterTemp="-1" flow="1" />
<Filter systemId="10" filterState="0" filterSpeed="0" valvePosition="1" whyFilterIsOn="1" fpOverride="0" reportedFilterSpeed="100" power="1338" lastSpeed="100" />
<VirtualHeater systemId="11" Current-Set-Point="92" enable="0" />
<Heater systemId="12" heaterState="0" temp="65535" enable="1" priority="0" maintainFor="24" />
<Chlorinator systemId="13" status="0" instantSaltLevel="0" avgSaltLevel="0" chlrAlert="0" chlrError="0" scMode="0" operatingState="1" Timed-Percent="10" operatingMode="1" />
<Group systemId="25" groupState="0" />
</STATUS>
Comparing with https://github.com/cryptk/python-omnilogic-local/blob/6f960b9b52e51e914cc8d630e8e14686da22fad5/pyomnilogic_local/models/telemetry.py#L30 it seems I may be on an old firmware.
Upgrading the firmware resolved this issue but now I'm running into https://github.com/cryptk/haomnilogic-local/issues/62.
First of all, thank you for starting this project!
I am getting errors while adding the integration.
Here is the configuration I used:
I can confirm that the HomeAssistant container can reach the OmniLogic controller: