Closed Sn00x closed 1 year ago
Please add the contents of the following endpoints:
http://<HOST>/api/v1/dimmer_config
http://<HOST>/api/v1/state
where <HOST>
can be the IP of your Dingz device.
The first endpoint is used by the integration to detect the configured dimmers and the latter is used to update their states. In your case, it seems like the first endpoint reports an amount of dimmers that isn't matched by the state updates -- hence, the index out of range error.
http://<HOST>/api/v1/dimmer_config
content (same structure, independent of switch configuration):
{
"dimmers":[
{
"output":"led",
"name":"Ausgang",
"feedback":null,
"feedback_intensity":100
},
{
"output":"led",
"name":"Ausgang",
"feedback":null,
"feedback_intensity":100
},
{
"output":"halogen",
"name":"Ausgang",
"feedback":null,
"feedback_intensity":100
},
{
"output":"halogen",
"name":"Ausgang",
"feedback":null,
"feedback_intensity":100
}
]
}
http://<HOST>/api/v1/state
content of a switch in 2 lights and 1 blind configuration:
{
"dimmers":[
{
"on":false,
"output":0,
"ramp":0,
"readonly":false,
"index":{
"relative":0,
"absolute":0
}
},
{
"on":true,
"output":34,
"ramp":5,
"readonly":false,
"index":{
"relative":1,
"absolute":1
}
}
],
"blinds":[
{
"moving":"stop",
"position":100,
"lamella":100,
"readonly":false,
"index":{
"relative":0,
"absolute":1
}
}
],
"led":{
"on":false,
"hsv":"190;100;0",
"rgb":"FFFFFF",
"mode":"hsv",
"ramp":1023
},
"sensors":{
"brightness":0,
"light_state":"night",
"room_temperature":20.5,
"uncompensated_temperature":38.25,
"temp_offset":0,
"cpu_temperature":66.67,
"puck_temperature":36,
"fet_temperature":35.3,
"input_state":null,
"person_present":0,
"power_outputs":[
{
"value":0
},
{
"value":0
},
{
"value":0
},
{
"value":0
}
]
},
"thermostat":{
"active":false,
"out":0,
"on":false,
"enabled":true,
"target_temp":21,
"mode":"heating",
"temp":20.5,
"min_target_temp":17,
"max_target_temp":31
},
"wifi":{
"version":"1.3.30",
"mac":"xxxxxxxxxxxx",
"ssid":"xxxxx",
"ip":"xx.xx.xx.xx",
"mask":"255.255.255.0",
"gateway":"xx.xx.xx.xx",
"dns":"xx.xx.xx.xx",
"static":false,
"connected":true
},
"time":"2021-12-22 20:29:49",
"config":{
"timestamp":1639953411
}
}
http://<HOST>/api/v1/state
content of a switch in 2 blinds configuration:
{
"dimmers":[
],
"blinds":[
{
"moving":"stop",
"position":99,
"lamella":50,
"readonly":false,
"index":{
"relative":0,
"absolute":0
}
},
{
"moving":"stop",
"position":100,
"lamella":100,
"readonly":false,
"index":{
"relative":1,
"absolute":1
}
}
],
"led":{
"on":false,
"hsv":"0;0;100",
"rgb":"FFFFFF",
"mode":"hsv",
"ramp":1023
},
...
http://<HOST>/api/v1/state
content of a switch in 4 lights configuration:
{
"dimmers":[
{
"on":false,
"output":0,
"ramp":0,
"readonly":true,
"index":{
"relative":0,
"absolute":0
}
},
{
"on":true,
"output":100,
"ramp":0,
"readonly":false,
"index":{
"relative":1,
"absolute":1
}
},
{
"on":false,
"output":0,
"ramp":0,
"readonly":false,
"index":{
"relative":2,
"absolute":2
}
},
{
"on":true,
"output":2,
"ramp":0,
"readonly":false,
"index":{
"relative":3,
"absolute":3
}
}
],
"blinds":[
],
"led":{
"on":false,
"hsv":"0;0;100",
"rgb":"FFFFFF",
"mode":"hsv",
"ramp":1023
},
...
Ah, I see. The problem is that the integration doesn't take into account that all configured dimmers are reported, even if they're not used. This is a bug in the integration that is somewhat difficult to fix, but there's a simple workaround for now:
Just go to the dimmer config page (http://<HOST>/index.html#/dimmers
) and switch all unused dimmers to the type "Not connected". That way the integration will no longer try to use them.
Unfortunately, the mentioned dimmer config page does not offer the possibility to set the type to "Not connected", as the outputs configured as blinds are not displayed at all.
That is, only the 4 lamps configuration page allows to set the respective type of the 4 outputs. With the 2 lamps 1 blinds configuration only the outputs 1 and 2 are listed, with the 2 blinds configuration none at all (empty configuration page).
I have around the same error logs as Sn00x. My condiguration is blinds on output 3 and 4, output 1 and 2 are configured as I use the for testing to call a shelly api and second for Sonos.
Logs lights: Logger: homeassistant.components.light Source: custom_components/dingz/light.py:102 Integration: Light (documentation, issues) First occurred: 22:58:24 (2 occurrences) Last logged: 22:58:24
Error adding entities for domain light with platform dingz Error while setting up dingz platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 511, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 935, in state return STATE_ON if self.is_on else STATE_OFF File "/config/custom_components/dingz/light.py", line 118, in is_on return self._dingz_dimmer.on File "/config/custom_components/dingz/light.py", line 102, in _dingz_dimmer return self._dingz_state.dimmers[self._index] IndexError: list index out of range
Logs cover: Logger: homeassistant.components.cover Source: custom_components/dingz/cover.py:43 Integration: Cover (documentation, issues) First occurred: 22:58:24 (2 occurrences) Last logged: 22:58:24
Error adding entities for domain cover with platform dingz Error while setting up dingz platform for cover Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 523, in _async_add_entity supported_features=entity.supported_features, File "/usr/src/homeassistant/homeassistant/components/cover/init.py", line 266, in supported_features if self.current_cover_position is not None: File "/config/custom_components/dingz/cover.py", line 61, in current_cover_position return self._dingz_blind.position File "/config/custom_components/dingz/cover.py", line 43, in _dingz_blind return self._dingz_state.blinds[self._index] IndexError: list index out of range
Logs custom: This error originated from a custom integration.
Logger: homeassistant Source: custom_components/dingz/light.py:102 Integration: dingz First occurred: 22:58:29 (23 occurrences) Last logged: 23:00:19
Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 511, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 935, in state return STATE_ON if self.is_on else STATE_OFF File "/config/custom_components/dingz/light.py", line 118, in is_on return self._dingz_dimmer.on File "/config/custom_components/dingz/light.py", line 102, in _dingz_dimmer return self._dingz_state.dimmers[self._index] IndexError: list index out of range
I also encountered that the sensors (temp, lux, motion) are not being updated and show the same value since 12 hours.
I also encountered that the sensors (temp, lux, motion) are not being updated and show the same value since 12 hours.
You should open a separate issue for that, I don't think it's entirely related to this one.
Closing this as there is a new version of the integration that might address this.
Thanks @siku2 for your effort for the dingz integration in Home Assistant - I think you make it easier for many people to configure these smart switches.
I use several switches in blind or mixed mode (light/blinds). After v0.1.5 caused problems with the indication of the entities, they get listed with v0.1.6, but the following errors still occur in the logfile:
The error counter increases steadily and relatively quickly.
A second error that is logged, which is also apparent, but occurs less frequently, but probably has the same cause:
It would be great if you could look over here again. Thanks!