planbnet / livisi_unofficial

Unofficial fork of the home assistant livisi integration without dependencies on the abandoned aiolivisi lib
Apache License 2.0
36 stars 5 forks source link

Add battery status for BT-WS #67

Closed aseeus closed 9 months ago

aseeus commented 10 months ago

Checklist

Is your feature request related to a problem? Please describe.

Currently battery status for BT-WS is missing

Describe the solution you'd like

Add "BT-WS" in BATTERY_POWERED_DEVICES in file const.py

"""Constants for the Livisi Smart Home integration.""" import logging from typing import Final

LOGGER = logging.getLogger(package) DOMAIN = "livisi"

LIVISI_EVENT = f"{DOMAIN}_event"

CONF_HOST = "host" CONF_PASSWORD: Final = "password"

CONF_SUBTYPE: Final = "subtype"

DEVICE_POLLING_DELAY: Final = 60 LIVISI_STATE_CHANGE: Final = "livisi_state_change" LIVISI_REACHABILITY_CHANGE: Final = "livisi_reachability_change"

BUTTON_COUNT: Final = {"BRC8": 8, "ISC2": 2, "ISS2": 2, "WSC2": 2, "ISR2": 2, "ISD2": 2}

BUTTON_DEVICE_TYPES: Final = list(BUTTON_COUNT.keys()) DIMMING_DEVICE_TYPES: Final = ["PSD", "ISD2"] MOTION_DEVICE_TYPES: Final = ["WMD", "WMDO"] SHUTTER_DEVICE_TYPES: Final = ["ISR2"] SIREN_DEVICE_TYPES: Final = ["SIR"] SMOKE_DETECTOR_DEVICE_TYPES: Final = ["WSD", "WSD2"] SWITCH_DEVICE_TYPES: Final = ["ISS2", "PSS", "PSSO", "BT-PSS"] VARIABLE_DEVICE_TYPES: Final = ["VariableActuator"] VRCC_DEVICE_TYPES: Final = ["VRCC"] WDS_DEVICE_TYPES: Final = ["WDS", "BT-WDS"]

BATTERY_POWERED_DEVICES = [ "BRC8", "ISC2", "RST", "RST2", "WDS", "WMD", "WMDO", "WSD", "WSD2", "SIR", "BT-WS", ]

CAPABILITY_LUMINANCE_SENSOR: Final = "LuminanceSensor" LUMINANCE: Final = "luminance"

CAPABILITY_TEMPERATURE_SENSOR: Final = "TemperatureSensor" CAPABILITY_ROOM_TEMPERATURE: Final = "RoomTemperature" TEMPERATURE: Final = "temperature"

CAPABILITY_HUMIDITY_SENSOR: Final = "HumiditySensor" CAPABILITY_ROOM_HUMIDITY: Final = "RoomHumidity" HUMIDITY: Final = "humidity"

CAPABILITY_POWER_SENSOR: Final = "PowerConsumptionSensor" POWER_CONSUMPTION: Final = "powerConsumptionWatt"

ON_STATE: Final = "onState" SHUTTER_LEVEL: Final = "shutterLevel" DIM_LEVEL: Final = "dimLevel" VALUE: Final = "value" POINT_TEMPERATURE: Final = "pointTemperature" SET_POINT_TEMPERATURE: Final = "setpointTemperature"

IS_OPEN: Final = "isOpen" IS_SMOKE_ALARM: Final = "isSmokeAlarm"

MAX_TEMPERATURE: Final = 30.0 MIN_TEMPERATURE: Final = 6.0

STATE_PROPERTIES = [ ON_STATE, VALUE, POINT_TEMPERATURE, SET_POINT_TEMPERATURE, TEMPERATURE, HUMIDITY, LUMINANCE, IS_OPEN, IS_SMOKE_ALARM, POWER_CONSUMPTION, SHUTTER_LEVEL, DIM_LEVEL, ]

EVENT_BUTTON_PRESSED = "button_pressed" EVENT_BUTTON_LONG_PRESSED = "button_long_pressed" EVENT_MOTION_DETECTED = "motion_detected"

Describe alternatives you've considered

No Alternatives. Described solution is easy and tested

Additional context

BT-WS

planbnet commented 10 months ago

What is BT-WS? I don't have any of these BT-* devices but curerntly only BT-WDS is supported by this integration

aseeus commented 9 months ago

What is BT-WS? I don't have any of these BT-* devices but curerntly only BT-WDS is supported by this integration

It is a Bluetooth LE room thermostat which was provided by Medion and can be integrated into the livisi climate control.

It provides temperature and humidity.

The thermostat has already been supported by the integration. Probably via climate control. Only the battery status is currently missing.

https://www.medion.com/de/shop/p/smart-home-system-medion-p85755-smart-home-starter-set-fuer-fortgeschrittene--ihr-zuhause-sicher-sparsam-smart-50054153A1

Picture 3&4 and in the text below search for MEDION® Smart Home Wetterstation.

Thanks a lot for implementing it :-)

aseeus commented 9 months ago

Is there a reason why you have closed this without adding the device?

planbnet commented 9 months ago

It has been added. See the linked commit.

aseeus commented 9 months ago

You added in line 44 a device called BT-WDS instead of the device I meant BT-WS

planbnet commented 9 months ago

I see - my bad... Added in 6491177

aseeus commented 9 months ago

Klasse. Vielen Dank :-)