Added pool pump
This commit is contained in:
parent
43c4eb5a07
commit
71a27b7d67
|
@ -75,13 +75,14 @@ switch:
|
||||||
- name: Bad Lüfter
|
- name: Bad Lüfter
|
||||||
fhem_ids:
|
fhem_ids:
|
||||||
- Bad_Luefter
|
- Bad_Luefter
|
||||||
|
- name: Pool Pumpe
|
||||||
|
fhem_ids:
|
||||||
|
- SteckdosenSchalter_Sw
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------ Motion Sensors ------------------------------------
|
# ------------------------------ Motion Sensors ------------------------------------
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
|
|
||||||
- name: Arbeitszimmer Martin Bewegungsmelder Batterie
|
- name: Arbeitszimmer Martin Bewegungsmelder Batterie
|
||||||
fhem_ids:
|
fhem_ids:
|
||||||
- ArbeitszimmerMartin_Bewegungsmelder
|
- ArbeitszimmerMartin_Bewegungsmelder
|
||||||
|
@ -91,8 +92,13 @@ binary_sensor:
|
||||||
- ArbeitszimmerMartin_Bewegungsmelder
|
- ArbeitszimmerMartin_Bewegungsmelder
|
||||||
fhem_sensor_type: motion
|
fhem_sensor_type: motion
|
||||||
|
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- name: Arbeitszimmer Martin Bewegungsmelder Helligkeit
|
- name: Arbeitszimmer Martin Bewegungsmelder Helligkeit
|
||||||
fhem_ids:
|
fhem_ids:
|
||||||
- ArbeitszimmerMartin_Bewegungsmelder
|
- ArbeitszimmerMartin_Bewegungsmelder
|
||||||
fhem_sensor_type: brightness
|
fhem_sensor_type: brightness
|
||||||
|
- name: Pool Pumpe Verbrauch
|
||||||
|
fhem_sensor_type: power
|
||||||
|
fhem_ids:
|
||||||
|
- SteckdosenSchalter_Pwr
|
||||||
|
|
|
@ -16,7 +16,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
vol.Required(CONF_FHEM_IDS): vol.All(cv.ensure_list, [cv.string]),
|
vol.Required(CONF_FHEM_IDS): vol.All(cv.ensure_list, [cv.string]),
|
||||||
vol.Required(CONF_NAME): cv.string,
|
vol.Required(CONF_NAME): cv.string,
|
||||||
vol.Optional(CONF_FHEM_SENSOR_TYPE, default='brightness'): vol.In(('brightness',)),
|
vol.Optional(CONF_FHEM_SENSOR_TYPE, default='brightness'): vol.In(('brightness', 'power')),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ class FhemSensor(Entity):
|
||||||
self._type = sensor_type
|
self._type = sensor_type
|
||||||
self._available = True
|
self._available = True
|
||||||
self._state = None
|
self._state = None
|
||||||
self._unsubscribe_motion_off = None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -67,6 +66,11 @@ class FhemSensor(Entity):
|
||||||
_, new_value = line.split(':')
|
_, new_value = line.split(':')
|
||||||
self._state = int(float(new_value) / 255 * 100)
|
self._state = int(float(new_value) / 255 * 100)
|
||||||
await self.async_update_ha_state()
|
await self.async_update_ha_state()
|
||||||
|
elif self._type == 'power':
|
||||||
|
self._available = True
|
||||||
|
_, new_value = line
|
||||||
|
self._state = int(new_value)
|
||||||
|
await self.async_update_ha_state()
|
||||||
elif line.startswith('ResndFail') or line.startswith('MISSING ACK'):
|
elif line.startswith('ResndFail') or line.startswith('MISSING ACK'):
|
||||||
self._available = False
|
self._available = False
|
||||||
await self.async_update_ha_state()
|
await self.async_update_ha_state()
|
||||||
|
@ -81,3 +85,5 @@ class FhemSensor(Entity):
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
if self._type == 'brightness':
|
if self._type == 'brightness':
|
||||||
return '%'
|
return '%'
|
||||||
|
elif self._type == 'power':
|
||||||
|
return 'W'
|
||||||
|
|
Loading…
Reference in New Issue