Deleting device from domoticz Topic is solved

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Deleting device from domoticz

Post by Dave21w »

Sorry the description is a little vague, I have an issue with my blinds (actually curtains) control, the status is permanently closed even though they open and close correctly, I have posted about this before but its not resolved so I plan on deleting the device from Domoticz but not from zigbee2mqtt as it's status in their is correct. As it's already present in z2m and was auto detected in Domoticz the first time it was installed if I delete it will it then be recreated again or is there some thing I need to do ?

Thanks
Dave
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Deleting device from domoticz

Post by ksacca »

Did you test my solution (workaround is better word actually) I posted on viewtopic.php?p=292630#p292630 ?
Adding value_template: null to the blind in configuration.yaml solved this for me.
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

When searching for a fix I probably missed your post because I was looking for curtains specifically, I'm using the Aqara Curtain Driver E1 which was working fine until Domoticz 2021 Beta 14528 or some where near that, since then and on stable 2022 they just say permanently closed. I'll give your fix a try and see what happens. A couple of questions though, are you using homeassistant above the value_template: null command because in z2m the discovery topic is set to homeassistant (in mine I have set the z2m topic to domoticz) and I take it I need to restart z2m after making the change.

Thanks for your quick response
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Deleting device from domoticz

Post by ksacca »

No, the autodiscovery part is called homeassistant in z2m, so don’t change that. You will need to resend the discovery message after the change though. The easy way I found was to rename the device and enable “update Home assistant entity ID” I believe. You can do this 2 times in a row to keep the correct name. Just add a space the first time, force update, correct the name, force update.
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

You my friend are a STAR !!
All working correctly now so I can finally move my notifications back to the actual curtain state rather then just the fact that the command was sent.

Thank you so much 😊
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Deleting device from domoticz

Post by ksacca »

You're welcome.

You could have fixed it 3 months ago if you didn't miss my reply to your post in https://domoticz.com/forum/viewtopic.ph ... 00#p293022 :D

Don't forget that if you change something to your curtain in the z2m UI, you might need to add it to the config again because it gets overwritten.
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

Probably missed it due to the 2 weeks in Cyprus from the first of Oct, Oh how long ago does that holiday feel :( !!
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

Just noticed that since adding the extra 2 lines to the device in the yaml file my curtain controllers now no longer report their battery state, is there a way around this ?
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

Now just found an even bigger problem, after adding the command to sort out the curtain state I then ended up with 190 push on buttons created all with the same settings and the name divided equally between Lounge Curtain Left and Lounge Curtain Right (so 95 of each button)

Lounge Curtain Left action_{"action":null,"battery":100,"charging":false,"device_temperature":19,"hooks_state":"locked","linkquality":87,"motor_state":"stopped","position":0,"power_outage_count":2,"power_source":"battery","running":false,"state":"CLOSE","target_position":0,"update":{"state":"available"},"update_available":true,"voltage":3000}
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

Can anybody help with this, I've commented out the 2 lines added to the yaml file for now which has restored my battery status etc and deleted the extra buttons that appeared but I'm back to curtains showing permanently closed again for now.
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Deleting device from domoticz

Post by ksacca »

Could you provide me the configuration for one of your blinds/curtains. You should be able to find it using MQTT Explorer.
MQTT Explorer has a button to copy the topic and the value.

As an example, in my case this is the topic for the config:

Code: Select all

zigbee2mqttAD/cover/0x0c4314fffe3fc90a/cover/config
And this is the value:

Code: Select all

{"availability":[{"topic":"zigbee2mqtt/bridge/state"}],"command_topic":"zigbee2mqtt/Gordijn/set","device":{"identifiers":["zigbee2mqtt_0x0c4314fffe3fc90a"],"manufacturer":"IKEA","model":"FYRTUR roller blind (E1757)","name":"Gordijn","sw_version":"2.3.088"},"json_attributes_topic":"zigbee2mqtt/Gordijn","name":"Gordijn","position_template":"{{ value_json.position }}","position_topic":"zigbee2mqtt/Gordijn","set_position_template":"{ \"position\": {{ position }} }","set_position_topic":"zigbee2mqtt/Gordijn/set","state_closed":"CLOSE","state_open":"OPEN","state_topic":"zigbee2mqtt/Gordijn","unique_id":"0x0c4314fffe3fc90a_cover_zigbee2mqtt"}
The you should find the update messages

In my case this is:

Code: Select all

zigbee2mqtt/Gordijn
With value:

Code: Select all

{"battery":63,"linkquality":34,"position":100,"state":"OPEN","update":{"state":"idle"},"update_available":false}
With this information, I can recreate your device exactly the way you see it and try to find out what happens (and if I can't find it maybe someone else might as I'm not an Autodiscovery expert.
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Deleting device from domoticz

Post by ksacca »

For others that might be following, I received all needed info by PM.

In this case, removing the value template causes zigbee2mqtt to remove it for all entities of the device (battery, voltage, ...).
Since they do have a valid value template like for example:

Code: Select all

"value_template":"{{ value_json.voltage }}" and "value_template":"{{ value_json.battery }}" 
They are not updated anymore in domoticz. So I created an issue on github (https://github.com/domoticz/domoticz/issues/5528).
I'm not familiar with c++, so maybe what I say in the issue is not correct. Anyway, let's hope we'll find a solution for this.
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Deleting device from domoticz

Post by ksacca »

Issue should be fixed in the latest beta thanks to gizmocus! See https://github.com/domoticz/domoticz/co ... 9f08f55a38 for more information.
Dave21w
Posts: 381
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Deleting device from domoticz

Post by Dave21w »

My original subject description was a little off base even though I did intend to delete / recreate a device to try and resolve an issue, even so my real problem was discussed further down the posts and I am very pleased to say resolved.

Many many thanks to ksacca for digging into the data I provided (and there was a lot!) and passing this info onto gizmocuz who has done yet another awesome job of getting a fix out already.

Can't thank you guys enough !!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest