Page 1 of 1

Z2M restart button not working.

Posted: Wednesday 24 January 2024 15:23
by rini52
Dear,

Try to use the auto discovered restart button of the the Z2M Sonof dongle but it failed. Same one is used in autodiscovery of Home assistant and there it works without any problem. I have to restart the Z2M so now and then, because of a USB problem on the PI-4 that is still (for years) not solved.
( i.e ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32 , caused by hardware/firmware problems so they say).

Has anyone an idea where to look to get it solved, so i can used the switch in an automatic recovery?

Thanks

Re: Z2M restart button not working.

Posted: Wednesday 24 January 2024 16:18
by waltervl
What auto discovered restart button of the the Z2M Sonof dongle do you mean?
Where is this button? In Z2M or Domoticz or on the stick?

Re: Z2M restart button not working.

Posted: Wednesday 24 January 2024 17:54
by rini52
I mean the switch in domoticz's switches tap (z2m-restart_z2m). This is auto created by the z2m auto detected (from the Sonof-dongle). You can push the symbol and than you get the error. In Home Assistant you get the same switch and there it works out-off the box. The ZB_waterpomp is also auto created from a Sonof-wall-socket build-in switch, but works oke.

I gues it has something to do with the device-class of these these things.

Regards

Re: Z2M restart button not working.

Posted: Wednesday 24 January 2024 19:01
by waltervl
Perhaps remove it and have it rediscovered with latest stable Domoticz version.

Also that switch should be somewhere in the Z2M user interface. What happens if you activate it from there?

Re: Z2M restart button not working.

Posted: Wednesday 24 January 2024 22:46
by rini52
I did remove the switch "restart" , but i don't seem to be able to re-discoverer it with AutoDectect in the new 2024.3 stable version. These are strange entries since they come from the Sonoff dongle (zstack- flashed with Z2M) itself. They don't have entries in the Z2M webpage like normal devices have.

In MQTT server you see under the discovery-tag long entries, like

homeassistant_domoticz/button/1221051039810110150109113116116_0x00124b00256c5929/restart/config

action:
{
"availability": [
{
"topic": "zigbee2mqtt/bridge/state",
"value_template": "{{ value_json.state }}"
}
],
"availability_mode": "all",
"command_topic": "zigbee2mqtt/bridge/request/restart",
"device": {
"hw_version": "zStack3x0 20220219",
"identifiers": [
"zigbee2mqtt_bridge_0x00124b00256c5929"
],
"manufacturer": "Zigbee2MQTT",
"model": "Bridge",
"name": "Zigbee2MQTT Bridge",
"sw_version": "1.35.1"
},
"device_class": "restart",
"name": "Restart",
"object_id": "zigbee2mqtt_bridge_restart",
"origin": {
"name": "Zigbee2MQTT",
"sw": "1.35.1",
"url": "https://www.zigbee2mqtt.io"
},
"payload_press": "",
"unique_id": "bridge_0x00124b00256c5929_restart_zigbee2mqtt"
}

But it did not get rediscovered again.....


So I give up on this one . Too detailed


BTW: MANY THANKS FOR THE NEW 2024.3 stable . Seem to run okay (apart from above)

Re: Z2M restart button not working.

Posted: Wednesday 31 January 2024 17:44
by rini52
Had a look in MqttAutoDiscover.cpp and there is a difference between 2024.1 and 2024.4 . In 2024.1 the test on "restart" is not skipped while in 2024.4 its left to a later stage where the button action is unwrapped. Obvious something is wrong there. Below the difference between 2024.1 and 2024.4 at the top.
The connection_state, log_level etc are handled properly. The permit_to_join is picked up from the Z2M dongle if changed.:)

The discovery tag is above in this chat.

Below the difference


2024.1 -->
//skip some non-needed types, they will be transmitted in the state topic anyways (for 90%) or not necessary
if (
(object_id == "update_available")
|| (object_id == "power_on_behavior")
|| (object_id == "power_outage_memory")
|| (object_id == "update_state")
|| (object_id == "over-load_status")
|| (object_id == "linkquality")
|| (object_id == "last_seen")
|| (object_id == "sensitivity")
|| (object_id == "color_temp_startup")
|| (object_id == "requested_brightness_level")
|| (object_id == "requested_brightness_percent")
|| (object_id == "device_automation")
|| (object_id == "over-load_status")
|| (object_id == "hardware_status")
|| (object_id.find("_address") != std::string::npos)
|| (object_id.find("_ssid") != std::string::npos)
|| (object_id.find("_signal_sensor") != std::string::npos)
)

2024.4 -->
//skip some non-needed types, they will be transmitted in the state topic anyways (for 90%) or not necessary
if (
(object_id == "update_available")
|| (object_id == "power_on_behavior")
|| (object_id == "power_outage_memory")
|| (object_id == "update_state")
|| (object_id == "over-load_status")
|| (object_id == "linkquality")
|| (object_id == "last_seen")
|| (object_id == "sensitivity")
|| (object_id == "color_temp_startup")
|| (object_id == "requested_brightness_level")
|| (object_id == "requested_brightness_percent")
|| (object_id == "device_automation")
|| (object_id == "over-load_status")
|| (object_id == "hardware_status")
|| (object_id.find("_address") != std::string::npos)
|| (object_id.find("_ssid") != std::string::npos)
|| (object_id.find("_signal_sensor") != std::string::npos)
|| (object_id == "connection_state")
|| (object_id == "log_level")
|| (object_id == "restart")
)


Don't know if the command button (associated with it) is already implemented en hope someone can have a look at it?