Hi i have fixed this bug in my instance.
Please, if someone can test my fix (Hass 0.92.1), ( @WhistleMaster ?)
I add the station’s name in unique id
in /homeassistant/components/netatmo/sensor.py
@@ -101,7 +101,7 @@
else:
# Only create sensors for monitored properties
for variable in monitored_conditions:
- dev.append(NetAtmoSensor(data, module_name, variable, config.get(CONF_STATION)))
+ dev.append(NetAtmoSensor(data, module_name, variable))
except pyatmo.NoDevice:
continue
@@ -121,7 +121,7 @@
for variable in \
data.station_data.monitoredConditions(module_name):
if variable in SENSOR_TYPES.keys():
- dev.append(NetAtmoSensor(data, module_name, variable, config.get(CONF_STATION)))
+ dev.append(NetAtmoSensor(data, module_name, variable))
else:
_LOGGER.warning("Ignoring unknown var %s for mod %s",
variable, module_name)
@@ -139,14 +139,13 @@
class NetAtmoSensor(Entity):
"""Implementation of a Netatmo sensor."""
- def __init__(self, netatmo_data, module_name, sensor_type, station):
+ def __init__(self, netatmo_data, module_name, sensor_type):
"""Initialize the sensor."""
self._name = 'Netatmo {} {}'.format(module_name,
SENSOR_TYPES[sensor_type][0])
self.netatmo_data = netatmo_data
self.module_name = module_name
self.type = sensor_type
- self.station_name = station
self._state = None
self._device_class = SENSOR_TYPES[self.type][3]
self._icon = SENSOR_TYPES[self.type][2]
@@ -154,7 +153,7 @@
self._module_type = self.netatmo_data. \
station_data.moduleByName(module=module_name)['type']
module_id = self.netatmo_data. \
- station_data.moduleByName(station=self.station_name,module=module_name)['_id']
+ station_data.moduleByName(module=module_name)['_id']
self._unique_id = '{}-{}'.format(module_id, self.type)
Seems to be fixed in 0.93.x but got another error:
2019-05-16 19:58:10 ERROR (SyncWorker_11) [homeassistant.components.netatmo.sensor] No Weather or HomeCoach devices found for Maison
2019-05-16 19:58:10 ERROR (SyncWorker_11) [homeassistant.components.netatmo.sensor] Module name: "XXX" not found
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 357, in _async_add_entity
raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.netatmo_indoor_noise. Platform netatmo does not generate unique IDs
2019-05-17 21:51:18 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 357, in _async_add_entity
raise HomeAssistantError(msg)
@maheus I’ve simply updated to HA 0.93.2 as I thought your patch was already merged on the git. If I understand correctly, I have to patch manually sensor.py, is that correct ?
Yes that’s it, you must patch manually for the moment (my patch was merged today in dev branch). @WhistleMaster also could you add , the option: discovery: false in your conf: