stas-demydiuk / domoticz-zigbee2mqtt-plugin

zigbee2mqtt plugin for domoticz
MIT License
136 stars 98 forks source link

[3.1-beta] Domoticz does not show the friendly names correctly in notifications #724

Closed kitopopo closed 2 years ago

kitopopo commented 2 years ago

dear @stas-demydiuk , I hadn't updated the plugin for 3 months, after the last update to the 3.1 plugin version I have seen an implementation in the plugin configuration through JSON. But I am not able to make domoticz show or detect the "friendly name", if not that it is sent as the device name of the "device id", is it possible to continue using the friendly name adding some data to the JSON structure? the friendly name continues to be configured correctly in zigbee2mqtt and is displayed in the device table.

{
    "domoticz": {
        "device_id": String     // Domoticz Device ID (not idx) in Domoticz
        "legacy_alias": String  // Alias, legacy key that was used in zigbee2mqtt plugin <= 3.0, required to support logical devices that were created before
        "unit": Number          // Domoticz Device Unit
    },
    "zigbee": {
        "address": String       // Zigbee IEEE Address
        "endpoint": String      // Zigbee endpoint (for devices that have multiple ones like switches with several buttons)
        "feture": String        // zigbee2mqtt feature name (power, state, temperature, etc.)
    }
}

thanks in advance, i wait news from you.

Best regards

Additional information Zigbee2MQTT version: zigbee2mqtt: v.1.21.1-dev (zStack3x0 20210120) Version: 2021.1 (build 13626) Build Hash: da57df49b Compile Date: 2021-09-28 07:54:37 dzVents Version: 3.1.8 Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]

stas-demydiuk commented 2 years ago

This configuration is just an internal structure that the plugin uses under the hood, could you please explain why do you need friendly_name there?

kitopopo commented 2 years ago

This configuration is just an internal structure that the plugin uses under the hood, could you please explain why do you need friendly_name there?

Dear friend,

I don't know if I need the implementation through the new JSON configuration. What I know so far is that with the old version of the zigbee2mqtt plugin I could correctly see the names in domoticz (friendly name), now and after updating the plugin to version 3.1 I do not see the names in telegram notifications that reach me. It is with the name of zigbee2mqtt as you can see in the example:

plugin with previous versions:
2021-10-03 16:31:54.304 Status: Notification: Sensor1 Salon Closed
2021-10-03 16:31:54.479 Status: dzVents: Info: Handling events for: "Sensor1 Salon", value: "Closed"

with plugin 3.1 updated
2021-10-03 16:42:56.378 Status: Notification: 0x00158d000273b8c6_sensor Open
2021-10-03 16:42:56.489 Status: dzVents: Info: Handling events for: "Sensor1 Salon", value: "Open"

I would like the names of my zigbee devices to show up as before and I don't know how to solve it. After update to the new JSON settings, the messages from my telegram bot arrive as 0x00158d000273b8c3_sensor closed. The notification is sent directly by domoticz through the device itself within the notifications menu of the device. I have 40 zigbee sensors and i lost the friendly names in the notifications. How i can solve it?

Thanks in advanced, best regards

stas-demydiuk commented 2 years ago

Please share your devices list and script that you are running. I suppose that you just need to rename your device on devices tab

kitopopo commented 2 years ago

Please share your devices list and script that you are running. I suppose that you just need to rename your device on devices tab

Dear friend, I do not have any script to send notifications from the zigbee opening sensors. It is the domoticz itself who is responsible for sending the notification through the opening sensor menu. I attach some photos so that you can understand me. I have tried to change the name of the opening sensor itself but the telegram notification remains the same.

1 2 3 4 .

Thanks in advanced

kitopopo commented 2 years ago

Dear @stas-demydiuk , any idea or solution? Thanks in advanced. Best regards

kitopopo commented 2 years ago

I just did a test and notifications through domoticz (fcm) are also received without the friendly name. I attach a photo. I hope this problem can be solved. Thanks in advance and best regards

Screenshot_20211013-012635_One UI Home

SargonofAssyria commented 2 years ago

Could not you just rename the devices in Domoticz?

kitopopo commented 2 years ago

Dear friend,

thank you for your reply. The names in domoticz are correct, simply when the notification is sent, instead of appearing the name of the device of domoticz, the name of the device of zigbee2mqtt appears. I have tried renaming the names of my devices but the notification is sent with the name of zigbee. This problem is also reflected in the domoticz log as you can see in my photos sent. It seems that in the last update of the plugin there is a problem with the names of the devices and domoticz. I have also tried renaming the "friendly name" inside the custom / zigbee2mqtt menu, but the result is the same. For some reason it keeps sending the IEEE address instead of the device name. Hopefully @stas-demydiuk can fix the problem in future updates. At the moment I remain in previous versions to 3.1.

Thank you very much best regards

kitopopo commented 2 years ago

Dear @stas-demydiuk ,

Many days have passed without knowing anything about the problem,

if the problem is not caused by the zigbee2mqtt plugin I can open an issue to @Koenkk or @gizmocuz in order to see if someone can solve the problem with the names of the devices when sending notifications.

Thanks in advance. greetings

stas-demydiuk commented 2 years ago

There are no changes in how the plugin handles the device names, so I guess the issue is somewhere in new Python Plugins Framework or the way how the plugin uses it.

Hopefully, @dnpwoo could take a look at what might cause it

SargonofAssyria commented 2 years ago

Strange. I still use the 'old' zigbee2mqtt plugin. I just tested it with a switch and I get a normal Telegram message in which the NAME of my device is mentioned (as in name from the device list in Domoticz) .

kitopopo commented 2 years ago

No hay cambios en la forma en que el complemento maneja los nombres de los dispositivos, así que supongo que el problema está en algún lugar del nuevo marco de complementos de Python o en la forma en que el complemento lo usa.

Con suerte, @dnpwoo podría echar un vistazo a lo que podría causarlo.

Exactly, @SargonofAssyria is right, with a previous version plugin 3.1 the names are received correctly, so I think something has to be changed in upgrade 3.1. I'm still using the previous version, after updating to 3.1 the correct names disappear

kitopopo commented 2 years ago

After upgrade the plugin to 3.1 version and azfter restart domoticz, we can see in domoticz log:

2021-10-28 13:41:42.749 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:42.771 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006b635c9(signal)
2021-10-28 13:41:42.771 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:42.795 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006b1c7a2(temp)
2021-10-28 13:41:42.795 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:42.819 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006b1c7a2(hum)
2021-10-28 13:41:42.819 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:42.842 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006b1c7a2(pres)
2021-10-28 13:41:42.842 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:42.866 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006b1c7a2(all) 
....
 2021-10-28 13:41:43.520 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006c03478(temp)
2021-10-28 13:41:43.521 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:43.547 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006c03478(btperc)
2021-10-28 13:41:43.547 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:43.574 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006c03478(motion)
2021-10-28 13:41:43.574 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:43.600 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006c03478(volt)
2021-10-28 13:41:43.600 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:43.627 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006c03478(lx)
2021-10-28 13:41:43.627 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:43.659 zigbe2mqtt: (zigbe2mqtt) Trying to get legacy device 0x00158d0006c03478(signal)
2021-10-28 13:41:43.659 zigbe2mqtt: (zigbe2mqtt) Success!
2021-10-28 13:41:43.828 zigbe2mqtt: (zigbe2mqtt) **Received available devices groups from bridge** 

it does this only with some devices. I have tested notifications with devices that appear in the list above and I have also tried notifications with devices that do not appear in the list but same problem. unlucky.

stas-demydiuk commented 2 years ago

Yes, it only confirms the assumption that the root cause is somewhere in migration to the DomoticzEx framework. At the moment I have no idea what could cause it, but maybe some of you could find the reason.

https://www.domoticz.com/wiki/Developing_a_Python_plugin

I guess the best action item would be to raise an issue in Domoticz repo with a clear explanation what the issue is and what the expected result and hopefully someone could help

kitopopo commented 2 years ago

Dear @stas-demydiuk ,

you were right, the problem with the name of the notifications was solved with the latest beta 13828. But now is impossible to access to custom --> zigbee2mqtt. I have commented on this in the other issue that I opened for domoticz. Thanks for you support. Best regards

stas-demydiuk commented 2 years ago

It's a known issue, see #729

kitopopo commented 2 years ago

It's a known issue, see #729

thanks again. Best regards