I also had problems with this, so I did a debug session with @ludeeus and will now try the new version of custom updater.
I did that (only that) restarted 2-3 times and … .the problem is still there.
Please note that I have deCONZ on a different host from HASSIO
I did that as well, therefore I’m asking @M203 if the only thing changed was commenting out custom_updater from configuration.
I have my deCONZ added through Add-on, so it’s running in a docker container. Yesterday i removed ALL custom_components and the problem was still there… Tried rebooting 2 times with removed deCONZ integration, upon re-adding deCONZ on the third reboot, it shows all entities, but the fourth reboot broke it again. Log says something along the lines of “deCONZ already added”.
Commented custom_updater. Removed tracker card and tracker card reference in raw config editor.
Does the deCONZ container change IP between restarts? That would break the integration.
That message is from discovery triggering a config flow in the integrations pane
In my case deCONZ has always the same IP (its on another host with a static IP address), and, it seems, I have the same problem as people running HASSIO+deconz addon
How could I improve debugging for you guys?
@Robban, i cannot guarantee that the IP is the same as they are floating, i’ve seen both 172.30.33.1 and 172.30.33.2 in the top corner of the Phoscon web-app.
I just tried to reboot with the changes @M203 had made.
Before reboot
The Phoscon web-app had an IP of 172.30.33.1 before reboot.
The core.config_entries had:
{
"connection_class": "local_push",
"data": {
"allow_clip_sensor": true,
"allow_deconz_groups": true,
"api_key": "API-KEY-HERE",
"bridgeid": "00212EFFFF032665",
"host": "172.30.33.1",
"port": 80
},
"domain": "deconz",
"entry_id": "11918dde3e8f4adfa4f42bc5ab458084",
"source": "user",
"title": "deCONZ-00212EFFFF032665",
"version": 1
}
After reboot
The Phoscon web-app had an IP of 172.30.33.1 after reboot.
The core.config_entries has:
{
"connection_class": "local_push",
"data": {
"allow_clip_sensor": true,
"allow_deconz_groups": true,
"api_key": "SAME-API-KEY",
"bridgeid": "00212EFFFF032665",
"host": "172.30.33.1",
"port": 80
},
"domain": "deconz",
"entry_id": "11918dde3e8f4adfa4f42bc5ab458084",
"source": "user",
"title": "deCONZ-00212EFFFF032665",
"version": 1
}
The log has the following:
Timeout getting deCONZ data from http://172.30.33.1:80/api/API-KEY-HERE.
Couldn’t load data from deCONZ
Config entry for deconz not ready yet. Retrying in 5 seconds.
Config entry failed since one deCONZ instance already exists
So in summary, removing custom_updater does nothing for me.
324/5000
Super Idea - Just a Question I have a battery status only in HA with my Xiaomi temperature sensors just how can I make this visible?
battery_level: 98
on: true
unit_of_measurement: ° C
friendly_name: temperature living room
icon: mdi: thermometer
device_class: temperature
is transmitted by deconz - Thank you
@terra2000 here you go, change the sensor entity to the one you need.
- platform: template
sensors:
multix_bad_battery:
friendly_name: Bad Multisensor batteri
unit_of_measurement: '%'
value_template: >
{% if states.sensor.multix_bad_temperature %}
{{ states.sensor.multix_bad_temperature.attributes.battery_level | default(0) | int }}
{% endif %}
icon_template: >
{% if states.sensor.multix_bad_temperature %}
{% set battery_level = states.sensor.multix_bad_temperature.attributes.battery_level | default(0) | int %}
{% set battery_round = (battery_level / 10) |int * 10 %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
Great - Thank you
@Robban i’m sorry that i ain’t to much help. I have some debug logs, but i don’t know where to look.
With deCONZ integration removed, the next reboot looks like this upon re-adding the deCONZ integration:
2019-02-27 13:00:21 INFO (MainThread) [homeassistant.loader] Loaded deconz from homeassistant.components.deconz
2019-02-27 13:00:25 DEBUG (MainThread) [pydeconz.utils] Sending {} to https://dresden-light.appspot.com/discover
2019-02-27 13:00:26 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{‘macaddress’: ‘00212EFFFF032665’, ‘name’: ‘Phoscon-GW’, ‘internalipaddress’: ‘172.30.33.1’, ‘publicipaddress’: ‘redacted’, ‘internalport’: 80, ‘id’: ‘00212EFFFF032665’}]
2019-02-27 13:00:26 INFO (MainThread) [pydeconz.utils] Discovered the following bridges: [{‘bridgeid’: ‘00212EFFFF032665’, ‘host’: ‘172.30.33.1’, ‘port’: 80}].
2019-02-27 13:00:30 INFO (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow/166f0bfc2d0747e6a622e7186469b73c to 192.168.10.1 (auth: True)
2019-02-27 13:00:30 DEBUG (MainThread) [pydeconz.utils] Sending {‘auth’: None, ‘data’: b’{“devicetype”: “pydeconz”}'} to http://172.30.33.1:80/api
2019-02-27 13:00:30 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{‘success’: {‘username’: ‘api-key’}}]
2019-02-27 13:00:30 INFO (MainThread) [pydeconz.utils] API key: api-key
2019-02-27 13:00:31 INFO (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow/166f0bfc2d0747e6a622e7186469b73c to 192.168.10.1 (auth: True)
2019-02-27 13:00:31 INFO (MainThread) [homeassistant.setup] Setting up deconz
2019-02-27 13:00:31 INFO (MainThread) [homeassistant.setup] Setup of domain deconz took 0.0 seconds.
2019-02-27 13:00:31 DEBUG (MainThread) [pydeconz.utils] Sending {} to http://172.30.33.1:80/api/api-key
Another reboot with the deCONZ integration added:
2019-02-27 13:10:53 INFO (MainThread) [homeassistant.setup] Setting up deconz
2019-02-27 13:10:53 INFO (MainThread) [homeassistant.setup] Setup of domain deconz took 0.0 seconds.
2019-02-27 13:10:53 DEBUG (MainThread) [pydeconz.utils] Sending {} to http://172.30.33.1:80/api/api-key same key as before
2019-02-27 13:11:06 ERROR (MainThread) [pydeconz.utils] Timeout getting deCONZ data from http://172.30.33.1:80/api/api-key. same key as before
2019-02-27 13:11:06 ERROR (MainThread) [pydeconz] Couldn’t load data from deCONZ
2019-02-27 13:11:06 WARNING (MainThread) [homeassistant.config_entries] Config entry for deconz not ready yet. Retrying in 5 seconds.
2019-02-27 13:11:16 ERROR (MainThread) [homeassistant.components.deconz] Config entry failed since one deCONZ instance already exists
Maybe this helps debugging the error? I noticed that the deconz integration is half way: the icons are not shown in deconz integration bar (and of course all entity_ids disappeared), but when you click on the deconz integration bar, it opens up the page where you see all the boxes with the entity_id as if they were in HASS (but they are not)
Just done another try with latest custom_updater and deCONZ fails again. It also takes ages to reboot.
@Klagio, I see the same thing as you describe. The locale is Danish btw.
Before reboot:
After reboot:
Yes I guess last box shows entity unavailable. So is not possible to do an integration, because integration is there (although broken)
what am I doing wrong
- platform: template
sensors:
temperatur_gastezimmer:
friendly_name: Gästezimmer Batterie
unit_of_measurement: ‘%’
value_template: >
{% if sensor.temperatur_gastezimmer %}
{{ states.sensor.temperatur_gastezimmer_attributes.battery_level | default(0) | int }}
{% endif %}
icon_template: >
{% if states.sensor.temperatur_gastezimmer %}
{% set battery_level = states.sensor.temperatur_gastezimmer.attributes.battery_level | default(0) | int %}
{% set battery_round = (battery_level / 10) |int * 10 %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
@terra2000 you need to provide logs another time and for god sake format your code, but here you go…
You need states before your senser.
My example:
{% if states.sensor.temperatur_gastezimmer %}
Yours:
{% if sensor.temperatur_gastezimmer %}
- platform: template
sensors:
temperatur_gastezimmer:
friendly_name: Gästezimmer Batterie
unit_of_measurement: '%'
value_template: >
{% if states.sensor.temperatur_gastezimmer %}
{{ states.sensor.temperatur_gastezimmer.attributes.battery_level | default(0) | int }}
{% endif %}
icon_template: >
{% if states.sensor.temperatur_gastezimmer %}
{% set battery_level = states.sensor.temperatur_gastezimmer.attributes.battery_level | default(0) | int %}
{% set battery_round = (battery_level / 10) |int * 10 %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
Thanks. Battery is at 0% in the dev-state it is at 75%. should change or?