Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodiscover MQTT and Nimly door lock #6046

Open
Timopen opened this issue Mar 27, 2024 · 4 comments
Open

Autodiscover MQTT and Nimly door lock #6046

Timopen opened this issue Mar 27, 2024 · 4 comments

Comments

@Timopen
Copy link

Timopen commented Mar 27, 2024

I have a Nimly touch pro door lock, supported by zigbee2MQTT as Onesti Products AS easyCodeTouch_v1.
zigbee2MQTT is publishing a couple of sensors, a switch for auto lock on/off and locking on/off.
The general/text sensors created as devices are:
last_unlock_source
last_unlock_user
last_lock_source
last_lock_user
These are all working and updated by topics in mqtt.
The switches created are:
switch_auto_relock
lock
sound_volume
Auto lock and lock are working but they don't update their state, they always show as off/unlocked, sound volume does not work at all but is not important to me.

Config sent by zigbee2mqtt for lock:
{
"availability": [
{
"topic": "homeassistant/bridge/state"
}
],
"command_topic": "homeassistant/0xf4ce3672e1a47d9c/set",
"device": {
"identifiers": [
"zigbee2mqtt_0xf4ce3672e1a47d9c"
],
"manufacturer": "Onesti Products AS",
"model": "Zigbee module for EasyAccess code touch series (easyCodeTouch_v1)",
"name": "0xf4ce3672e1a47d9c",
"sw_version": "4.5.26",
"via_device": "zigbee2mqtt_bridge_0x4c5bb3fffed6bc38"
},
"json_attributes_topic": "homeassistant/0xf4ce3672e1a47d9c",
"name": null,
"object_id": "0xf4ce3672e1a47d9c",
"origin": {
"name": "Zigbee2MQTT",
"sw": "1.36.0",
"url": "https://www.zigbee2mqtt.io"
},
"state_locked": "LOCK",
"state_topic": "homeassistant/0xf4ce3672e1a47d9c",
"state_unlocked": "UNLOCK",
"unique_id": "0xf4ce3672e1a47d9c_lock_homeassistant",
"value_template": "{{ value_json.state }}"
}

Config sent by zigbee2mqtt for auto lock:
{
"availability": [
{
"topic": "homeassistant/bridge/state"
}
],
"command_topic": "homeassistant/0xf4ce3672e1a47d9c/set/auto_relock",
"device": {
"identifiers": [
"zigbee2mqtt_0xf4ce3672e1a47d9c"
],
"manufacturer": "Onesti Products AS",
"model": "Zigbee module for EasyAccess code touch series (easyCodeTouch_v1)",
"name": "0xf4ce3672e1a47d9c",
"sw_version": "4.5.26",
"via_device": "zigbee2mqtt_bridge_0x4c5bb3fffed6bc38"
},
"json_attributes_topic": "homeassistant/0xf4ce3672e1a47d9c",
"name": "Auto relock",
"object_id": "0xf4ce3672e1a47d9c_auto_relock",
"origin": {
"name": "Zigbee2MQTT",
"sw": "1.36.0",
"url": "https://www.zigbee2mqtt.io"
},
"payload_off": "false",
"payload_on": "true",
"state_topic": "homeassistant/0xf4ce3672e1a47d9c",
"unique_id": "0xf4ce3672e1a47d9c_switch_auto_relock_homeassistant",
"value_template": "{% if value_json.auto_relock %} true {% else %} false {% endif %}"
}
Topic sent by zigbee2mqtt to homeassistant/0xf4ce3672e1a47d9c:
{
"auto_relock": true,
"auto_relock_time": 1,
"battery": 100,
"last_lock_source": "self",
"last_lock_user": 0,
"last_unlock_source": "rfid",
"last_unlock_user": 3,
"last_used_pin_code": null,
"linkquality": 68,
"lock_state": "locked",
"pin_code": null,
"sound_volume": "high_volume",
"state": "LOCK",
"voltage": 4500
}

Log in Domoticz:
2024-03-27 18:40:09.069 MQTT: General/Text (0xf4ce3672e1a47d9c (Last lock source))
2024-03-27 18:40:09.071 MQTT: General/Custom Sensor (0xf4ce3672e1a47d9c (Last lock user))
2024-03-27 18:40:09.073 MQTT: General/Text (0xf4ce3672e1a47d9c (Last unlock source))
2024-03-27 18:40:09.075 MQTT: General/Custom Sensor (0xf4ce3672e1a47d9c (Last unlock user))
2024-03-27 18:40:09.076 MQTT: General/Text (0xf4ce3672e1a47d9c (Sound volume))
2024-03-27 18:40:09.085 Status: dzVents: Debug: Dumping domoticz data to /home/tipe/domoticz/scripts/dzVents/domoticzData.lua
2024-03-27 18:40:09.103 Status: dzVents: Debug: Processing device-adapter for 0xf4ce3672e1a47d9c (Last lock source): Text device
2024-03-27 18:40:09.103 Status: dzVents: Debug: dzVents version: 3.1.8
2024-03-27 18:40:09.103 Status: dzVents: Debug: Event triggers:
2024-03-27 18:40:09.103 Status: dzVents: Debug: - Device: 0xf4ce3672e1a47d9c (Last lock source)
2024-03-27 18:40:09.109 Status: LUA: Device based event fired on '0xf4ce3672e1a47d9c (Last lock source)', value 'self'
2024-03-27 18:40:09.125 Status: dzVents: Debug: Dumping domoticz data to /home/tipe/domoticz/scripts/dzVents/domoticzData.lua
2024-03-27 18:40:09.143 Status: dzVents: Debug: Processing device-adapter for 0xf4ce3672e1a47d9c (Last lock user): Custom sensor device adapter
2024-03-27 18:40:09.144 Status: dzVents: Debug: Processing device-adapter for 0xf4ce3672e1a47d9c (Last unlock source): Text device
2024-03-27 18:40:09.144 Status: dzVents: Debug: Processing device-adapter for 0xf4ce3672e1a47d9c (Last unlock user): Custom sensor device adapter
2024-03-27 18:40:09.144 Status: dzVents: Debug: dzVents version: 3.1.8
2024-03-27 18:40:09.144 Status: dzVents: Debug: Event triggers:
2024-03-27 18:40:09.144 Status: dzVents: Debug: - Device: 0xf4ce3672e1a47d9c (Last lock user)
2024-03-27 18:40:09.144 Status: dzVents: Debug: - Device: 0xf4ce3672e1a47d9c (Last unlock source)
2024-03-27 18:40:09.144 Status: dzVents: Debug: - Device: 0xf4ce3672e1a47d9c (Last unlock user)
2024-03-27 18:40:09.150 Status: LUA: Device based event fired on '0xf4ce3672e1a47d9c (Last lock user)', value '0'
2024-03-27 18:40:09.151 Status: LUA: Device based event fired on '0xf4ce3672e1a47d9c (Last unlock source)', value 'rfid'
2024-03-27 18:40:09.152 Status: LUA: Device based event fired on '0xf4ce3672e1a47d9c (Last unlock user)', value '3'
2024-03-27 18:40:09.152 Status: LUA: Device based event fired on '0xf4ce3672e1a47d9c (Last unlock user)_Utility', value '3.0'

In the UI for zigbee2MQTT you are able to operate the lock as expected.
Also there are no logs on the devices in Domotics, it would be nice to see history of unlocking/locking users.

@waltervl
Copy link
Collaborator

waltervl commented Mar 27, 2024

Do you have only an homeassistant MQTT topic related to zigbee2MQTT? As for normal configuration you should have a zigbee2MQTT topic for state updates and an homeassistant topic for config topics. The state topic and config topic cannot be the same for Domoticz MQTT AD.

Do you have other zigbee2mqtt devices in your setup? And if yes are they working normally?

@Timopen
Copy link
Author

Timopen commented Mar 28, 2024

The config topics are:
homeassistant/lock/0xf4ce3672e1a47d9c/lock (only working to lock as the state is always unlocked)
homeassistant/switch/0xf4ce3672e1a47d9c/switch_auto_relock (only working to set on as the state is always off)
homeassistant/sensor/0xf4ce3672e1a47d9c/battery (not created as device)
homeassistant/sensor/0xf4ce3672e1a47d9c/sound_volume (created as switch but not working)
homeassistant/sensor/0xf4ce3672e1a47d9c/last_unlock_source (working as expected)
homeassistant/sensor/0xf4ce3672e1a47d9c/last_unlock_user (working as expected)
homeassistant/sensor/0xf4ce3672e1a47d9c/last_lock_source (working as expected)
homeassistant/sensor/0xf4ce3672e1a47d9c/last_lock_user (working as expected)
homeassistant/sensor/0xf4ce3672e1a47d9c/last_used_pin_code (not created)
homeassistant/sensor/0xf4ce3672e1a47d9c/pin_code (not created as device)
homeassistant/sensor/0xf4ce3672e1a47d9c/linkquality (not created as device)
At the moment I dont have any other zibee devices, I'm thinking of going to IKEA to buy some just to test.
The platform is a new Raspberry pi 5 4GB that are going to replace my old Domotics pi.
Domotics version is 2024.4, I connected the autodiscovery MQTT hardware on the old Domotics pi (2024.3) to the MQTT server and got exactly the same result. There is also a post in the forum where another user has the same problem.
https://www.domoticz.com/forum/viewtopic.php?t=40970

@waltervl
Copy link
Collaborator

Your Zigbee2MQTT configuration seems not correct. Did you change anything in Zigbee2MQTT for topics?

@Timopen
Copy link
Author

Timopen commented Mar 28, 2024

Yes, I had the wrong base_topic for MQTT.
Changed it from homeassistant to zigbee2mqtt, removed hardware from Domoticz, cleared all topics in MQTT, removed the lock device from zigbee2mqtt and restarted everything.
Paired the lock again and added the MQTT auto discovery hardware to Domoticz.
Same problem as before.
The configs are in the same topics as before, but the state topic is now zigbee2mqtt/0xf4ce3672e1a47d9c
Config for lock under homeassistant/lock/0xf4ce3672e1a47d9c/lock:

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state"
    }
  ],
  "command_topic": "zigbee2mqtt/0xf4ce3672e1a47d9c/set",
  "device": {
    "identifiers": [
      "zigbee2mqtt_0xf4ce3672e1a47d9c"
    ],
    "manufacturer": "Onesti Products AS",
    "model": "Zigbee module for EasyAccess code touch series (easyCodeTouch_v1)",
    "name": "0xf4ce3672e1a47d9c",
    "sw_version": "4.5.26",
    "via_device": "zigbee2mqtt_bridge_0x4c5bb3fffed6bc38"
  },
  "json_attributes_topic": "zigbee2mqtt/0xf4ce3672e1a47d9c",
  "name": null,
  "object_id": "0xf4ce3672e1a47d9c",
  "origin": {
    "name": "Zigbee2MQTT",
    "sw": "1.36.0",
    "url": "https://www.zigbee2mqtt.io"
  },
  "state_locked": "LOCK",
  "state_topic": "zigbee2mqtt/0xf4ce3672e1a47d9c",
  "state_unlocked": "UNLOCK",
  "unique_id": "0xf4ce3672e1a47d9c_lock_zigbee2mqtt",
  "value_template": "{{ value_json.state }}"
}

Config for auto_lock under homeassistant/switch/0xf4ce3672e1a47d9c/switch_auto_relock:

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state"
    }
  ],
  "command_topic": "zigbee2mqtt/0xf4ce3672e1a47d9c/set/auto_relock",
  "device": {
    "identifiers": [
      "zigbee2mqtt_0xf4ce3672e1a47d9c"
    ],
    "manufacturer": "Onesti Products AS",
    "model": "Zigbee module for EasyAccess code touch series (easyCodeTouch_v1)",
    "name": "0xf4ce3672e1a47d9c",
    "sw_version": "4.5.26",
    "via_device": "zigbee2mqtt_bridge_0x4c5bb3fffed6bc38"
  },
  "json_attributes_topic": "zigbee2mqtt/0xf4ce3672e1a47d9c",
  "name": "Auto relock",
  "object_id": "0xf4ce3672e1a47d9c_auto_relock",
  "origin": {
    "name": "Zigbee2MQTT",
    "sw": "1.36.0",
    "url": "https://www.zigbee2mqtt.io"
  },
  "payload_off": "false",
  "payload_on": "true",
  "state_topic": "zigbee2mqtt/0xf4ce3672e1a47d9c",
  "unique_id": "0xf4ce3672e1a47d9c_switch_auto_relock_zigbee2mqtt",
  "value_template": "{% if value_json.auto_relock %} true {% else %} false {% endif %}"
}

State message under zigbee2mqtt/0xf4ce3672e1a47d9c:

{
  "auto_relock": null,
  "battery": 100,
  "last_lock_source": "self",
  "last_lock_user": 0,
  "last_unlock_source": "self",
  "last_unlock_user": 0,
  "last_used_pin_code": null,
  "linkquality": 72,
  "lock_state": "locked",
  "pin_code": null,
  "sound_volume": "high_volume",
  "state": "LOCK"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants