diff --git a/custom_components/econet300/const.py b/custom_components/econet300/const.py index ce9410b..49f1d22 100644 --- a/custom_components/econet300/const.py +++ b/custom_components/econet300/const.py @@ -45,20 +45,20 @@ ## Boiler staus keys map # boiler mode names from endpoint http://LocalIP/econet/rmParamsEnums? OPERATION_MODE_NAMES = { - 0: "TURNED OFF", - 1: "FIRE UP", - 2: "FIRE UP", - 3: "WORK", - 4: "SUPERVISION", - 5: "Halted", - 6: "STOP", - 7: "BURNING OFF", - 8: "MANUAL", - 9: "ALARM", - 10: "UNSEALING", - 11: "CHIMNEY", - 12: "STABILIZATION", - 13: "NO TRANSMISSION", + 0: "off", + 1: "fire_up", + 2: "fire_up", + 3: "work", + 4: "supervision", + 5: "halted", + 6: "stop", + 7: "burning_off", + 8: "manual", + 9: "alarm", + 10: "unsealing", + 11: "chimney", + 12: "stabilization", + 13: "no_transmission", } # add constants to future @@ -254,13 +254,17 @@ } ENTITY_VALUE_PROCESSOR = { - "mode": lambda x: OPERATION_MODE_NAMES.get(x, "Unknown"), - "thermostat": lambda x: "ON" - if str(x).strip() == "true" - else ("OFF" if str(x).strip() == "false" else None), - "lambdaStatus": lambda x: "STOP" - if x == 0 - else ("START" if x == 1 else ("Working" if x == 2 else "Unknown")), + "mode": lambda x: OPERATION_MODE_NAMES.get(x, "unknown"), + "thermostat": ( + lambda x: "ON" + if str(x).strip() == "true" + else ("OFF" if str(x).strip() == "false" else None) + ), + "lambdaStatus": ( + lambda x: "stop" + if x == 0 + else ("start" if x == 1 else ("working" if x == 2 else "unknown")) + ), "status_wifi": lambda x: "Connected" if x == 1 else "Disconnected", "main_server": lambda x: "Server available" if x == 1 else "Server not available", } diff --git a/custom_components/econet300/strings.json b/custom_components/econet300/strings.json index 60f25e1..7025ca6 100644 --- a/custom_components/econet300/strings.json +++ b/custom_components/econet300/strings.json @@ -33,24 +33,59 @@ }, "sensor": { "boiler_power": { "name": "Boiler power" }, - "temp_external_sensor": { "name": "Outside temperature" }, - "temp_feeder": {"name": "Feeder temperature"}, "fuel_level": { "name": "Fuel level" }, - "thermostat": { "name": "Thermostat" }, - "lambda_status": { "name": "Lambda status" }, + "fan_power": { "name": "Fan power" }, + "fan_works": { "name": "Fan" }, + "lambda_status": { + "name": "Lambda status", + "state": { + "stop": "Stop", + "start": "Start", + "working": "Working", + "unknown": "Unknown" + } + }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, + "main_server": { "name": "Main server" }, + "mode": { + "name": "Boiler mode", + "state": { + "off": "[%key:common::state::off%]", + "fire_up": "Fire up", + "work": "Work", + "supervision": "Supervision", + "halted": "Halted", + "stop": "Stop", + "burning_off": "Burning off", + "manual": "Manual", + "alarm": "Alarm", + "unsealing": "Unsealing", + "chimney": "Chimney", + "stabilization": "Stabilization", + "no_transmission": "No transmission", + "unknown": "Unknown" + } + }, + "mixer_temp1": { "name": "Mixer 1 temperature" }, + "mixer_set_temp1": { "name": "Mixer target temperature" }, + "pump_cwu_works": { "name": "HUW pump" }, + "pump_fireplace_works": { "name": "Boiler pump" }, "signal": { "name": "Signal quality" }, + "servo_mixer1": { "name": "Mixer 1 servo position" }, + "status_wifi": { "name": "Wireless network connected" }, "temp_co": { "name": "Heating temperature" }, "temp_cwu": { "name": "Water heater temperature" }, "temp_upper_buffer": { "name": "Upper buffer temperature" }, "temp_lower_buffer": { "name": "Lower buffer temperature" }, "temp_flue_gas": { "name": "Flue gas temperature" }, - "mixer_temp1": { "name": "Mixer 1 temperature" }, - "mixer_set_temp1": { "name": "Mixer target temperature" }, - "mode": { "name": "Boiler mode" }, - "fan_power": { "name": "Fan power" }, - "temp_co_set": { "name": "Heating target temperature" } + "temp_external_sensor": { "name": "Outside temperature" }, + "temp_feeder": {"name": "Feeder temperature"}, + "temp_co_set": { "name": "Heating target temperature" }, + "thermostat": { "name": "Thermostat" }, + "unseal": { "name": "Unseal" }, + "valve_mixer1": { "name": "Mixer 1 valve % open" }, + "weather_control": {"name": "Weather control the boiler"} } } } diff --git a/custom_components/econet300/translations/en.json b/custom_components/econet300/translations/en.json index 36078f2..94f5a80 100644 --- a/custom_components/econet300/translations/en.json +++ b/custom_components/econet300/translations/en.json @@ -36,11 +36,37 @@ "fuel_level": { "name": "Fuel level" }, "fan_power": { "name": "Fan power" }, "fan_works": { "name": "Fan" }, - "lambda_status": { "name": "Lambda status" }, + "lambda_status": { + "name": "Lambda status", + "state": { + "stop": "Stop", + "start": "Start", + "working": "Working", + "unknown": "Unknown" + } + }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, "main_server": { "name": "Main server" }, - "mode": { "name": "Boiler mode" }, + "mode": { + "name": "Boiler mode", + "state": { + "off": "Off", + "fire_up": "Fire up", + "work": "Work", + "supervision": "Supervision", + "halted": "Halted", + "stop": "Stop", + "burning_off": "Burning off", + "manual": "Manual", + "alarm": "Alarm", + "unsealing": "Unsealing", + "chimney": "Chimney", + "stabilization": "Stabilization", + "no_transmission": "No transmission", + "unknown": "Unknown" + } + }, "mixer_temp1": { "name": "Mixer 1 temperature" }, "mixer_set_temp1": { "name": "Mixer target temperature" }, "pump_cwu_works": { "name": "HUW pump" }, @@ -62,4 +88,4 @@ "weather_control": {"name": "Weather control the boiler"} } } -} \ No newline at end of file +} diff --git a/custom_components/econet300/translations/pl.json b/custom_components/econet300/translations/pl.json index 4efcc98..d8fe0a3 100644 --- a/custom_components/econet300/translations/pl.json +++ b/custom_components/econet300/translations/pl.json @@ -36,13 +36,39 @@ "fuel_level": { "name": "Poziom paliwa" }, "fan_works": { "name": "Fan" }, "fan_power": { "name": "Moc nadmuchu" }, - "lambda_status": { "name": "Lambda status" }, + "lambda_status": { + "name": "Lambda status", + "state": { + "stop": "Stop", + "start": "Start", + "working": "Working", + "unknown": "Unknown" + } + }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Czujnik Lambda" }, "mixer_temp1": { "name": "Temp. mieszacza 1" }, "mixer_set_temp1": { "name": "Temp. zadana mieszacza 1" }, "main_server": { "name": "Główny serwer" }, - "mode": { "name": "Tryb pracy" }, + "mode": { + "name": "Tryb pracy", + "state": { + "off": "Off", + "fire_up": "Fire up", + "work": "Work", + "supervision": "Supervision", + "halted": "Halted", + "stop": "Stop", + "burning_off": "Burning off", + "manual": "Manual", + "alarm": "Alarm", + "unsealing": "Unsealing", + "chimney": "Chimney", + "stabilization": "Stabilization", + "no_transmission": "No transmission", + "unknown": "Unknown" + } + }, "pump_cwu_works": { "name": "HUW pump" }, "pump_fireplace_works": { "name": "Boiler pump" }, "valve_mixer1": { "name": "Zawór mieszacza 1" },