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

Some states not published #34

Closed
tnowak opened this issue Mar 17, 2020 · 9 comments
Closed

Some states not published #34

tnowak opened this issue Mar 17, 2020 · 9 comments

Comments

@tnowak
Copy link

tnowak commented Mar 17, 2020

Hi,
I'm new to ioBroker and MQTT-client adapter but I'm ambitiously trying to use it with ecovacs-deebot adapter. Version 1.3.1 mostly works fine, but I can't figure out why some of Deebot states are not being published at MQTT broker at all.

I have enabled MQTT-client (main checkbox) and publish (all, not only changes) with retain flag on 11 objects:

These get published:
iobroker/ecovacs-deebot/0/info/deviceStatus
iobroker/ecovacs-deebot/0/info/cleanstatus
iobroker/ecovacs-deebot/0/info/chargestatus
iobroker/ecovacs-deebot/0/history/dateOfLastStartCharging
iobroker/ecovacs-deebot/0/history/dateOfLastStartCleaning
iobroker/ecovacs-deebot/0/history/timestampOfLastStartCharging
iobroker/ecovacs-deebot/0/history/timestampOfLastStartCleaning

Those don't get published at all:
iobroker/ecovacs-deebot/0/info/battery
iobroker/ecovacs-deebot/0/consumable/filter
iobroker/ecovacs-deebot/0/consumable/main_brush
iobroker/ecovacs-deebot/0/consumable/side_brush

Configuration is the same. Any idea why? How can I debug it?

image

image

image

Only this gets published:

image

@mrbungle64
Copy link

Hi @tnowak

maybe it's because all the states you mentioned using a unit (%). You can try if it is caused by this by emptying the "unit" attribute.

@tnowak
Copy link
Author

tnowak commented Mar 18, 2020

Hi @mrbungle64

Thanks for the tip although I believe the unit is being only used after the value within ioBroker admin panel.
Before I tried your tip it I've checked Mosquito again and found out that battery somehow got published during last night (with % set as unit, Mosquito got only value "100").
Still no /consumable/ values in MQTT. I tried removing the unit on all those 3 objects but that did not change anything..

But I discovered something new. I restarted MQTT-client instance serveral times and found such records in the log (its reverse, newest on top)

Restart #1

mqtt-client.0	2020-03-18 15:15:21.484	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/filter
mqtt-client.0	2020-03-18 15:15:21.479	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.filter (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:14:42.629	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/side brush
mqtt-client.0	2020-03-18 15:14:42.624	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.side_brush (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:14:35.714	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/side_brush
mqtt-client.0	2020-03-18 15:14:35.710	info	(1186) disabled syncing of ecovacs-deebot.0.consumable.side_brush
mqtt-client.0	2020-03-18 15:14:25.999	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/main brush
mqtt-client.0	2020-03-18 15:14:25.992	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.main_brush (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:14:18.124	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/main_brush
mqtt-client.0	2020-03-18 15:14:18.120	info	(1186) disabled syncing of ecovacs-deebot.0.consumable.main_brush
mqtt-client.0	2020-03-18 15:13:47.679	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/filter
mqtt-client.0	2020-03-18 15:13:47.674	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.filter (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:13:38.386	info	(1186) unsubscribed from ecovacs-deebot/0/consumable/filter
mqtt-client.0	2020-03-18 15:13:38.380	info	(1186) disabled syncing of ecovacs-deebot.0.consumable.filter
mqtt-client.0	2020-03-18 15:11:46.218	info	(1186) connected to broker
mqtt-client.0	2020-03-18 15:11:46.009	info	(1186) Try to connect to mqtt://loxberry:*******************@192.168.103.33:1883?clientId=iobroker with lwt "status"
mqtt-client.0	2020-03-18 15:11:46.008	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.side_brush (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:46.004	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.main_brush (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:46.001	info	(1186) enabled syncing of ecovacs-deebot.0.consumable.filter (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:45.998	info	(1186) enabled syncing of ecovacs-deebot.0.history.timestampOfLastStartCharging (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:45.995	info	(1186) enabled syncing of ecovacs-deebot.0.history.timestampOfLastStartCleaning (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:45.992	info	(1186) enabled syncing of ecovacs-deebot.0.info.chargestatus (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:45.990	info	(1186) enabled syncing of ecovacs-deebot.0.info.cleanstatus (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:45.987	info	(1186) enabled syncing of ecovacs-deebot.0.info.deviceStatus (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:11:45.984	info	(1186) enabled syncing of ecovacs-deebot.0.info.battery (publish/subscribe:true/false)
mqtt-client.0	2020-03-18 15:22:36.128	info	(1201) enabled syncing of ecovacs-deebot.0.control.playIamHere (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:22:36.125	info	(1201) enabled syncing of ecovacs-deebot.0.control.playSound (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:22:36.122	info	(1201) enabled syncing of ecovacs-deebot.0.control.charge (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:22:36.119	info	(1201) enabled syncing of ecovacs-deebot.0.control.resume (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:22:36.116	info	(1201) enabled syncing of ecovacs-deebot.0.control.pause (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:22:36.113	info	(1201) enabled syncing of ecovacs-deebot.0.control.stop (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:22:36.109	info	(1201) enabled syncing of ecovacs-deebot.0.control.clean (publish/subscribe:false/true)
mqtt-client.0	2020-03-18 15:11:45.768	info	(1186) starting. Version 1.3.1 in /opt/iobroker/node_modules/iobroker.mqtt-client, node: v10.19.0

Restart #2

mqtt-client.0 | 2020-03-18 15:32:02.593 | info | (1216) unsubscribed from ecovacs-deebot/0/info/battery
mqtt-client.0 | 2020-03-18 15:32:02.587 | info | (1216) enabled syncing of ecovacs-deebot.0.info.battery (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:31:46.232 | info | (1216) unsubscribed from ecovacs-deebot/0/info/battery
mqtt-client.0 | 2020-03-18 15:31:46.225 | info | (1216) enabled syncing of ecovacs-deebot.0.info.battery (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.441 | info | (1216) connected to broker
mqtt-client.0 | 2020-03-18 15:27:45.225 | info | (1216) Try to connect to mqtt://loxberry:*******************@192.168.103.33:1883?clientId=iobroker with lwt "status"
mqtt-client.0 | 2020-03-18 15:27:45.224 | info | (1216) enabled syncing of ecovacs-deebot.0.consumable.side_brush (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.221 | info | (1216) enabled syncing of ecovacs-deebot.0.consumable.main_brush (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.218 | info | (1216) enabled syncing of ecovacs-deebot.0.consumable.filter (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.215 | info | (1216) enabled syncing of ecovacs-deebot.0.history.timestampOfLastStartCharging (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.213 | info | (1216) enabled syncing of ecovacs-deebot.0.history.timestampOfLastStartCleaning (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.210 | info | (1216) enabled syncing of ecovacs-deebot.0.info.chargestatus (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.207 | info | (1216) enabled syncing of ecovacs-deebot.0.info.cleanstatus (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.204 | info | (1216) enabled syncing of ecovacs-deebot.0.info.deviceStatus (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.201 | info | (1216) enabled syncing of ecovacs-deebot.0.info.battery (publish/subscribe:true/false)
mqtt-client.0 | 2020-03-18 15:27:45.199 | info | (1216) enabled syncing of ecovacs-deebot.0.control.playIamHere (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:45.196 | info | (1216) enabled syncing of ecovacs-deebot.0.control.playSound (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:45.193 | info | (1216) enabled syncing of ecovacs-deebot.0.control.charge (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:45.190 | info | (1216) enabled syncing of ecovacs-deebot.0.control.resume (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:45.187 | info | (1216) enabled syncing of ecovacs-deebot.0.control.pause (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:45.183 | info | (1216) enabled syncing of ecovacs-deebot.0.control.stop (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:45.178 | info | (1216) enabled syncing of ecovacs-deebot.0.control.clean (publish/subscribe:false/true)
mqtt-client.0 | 2020-03-18 15:27:44.984 | info | (1216) starting. Version 1.3.1 in /opt/iobroker/node_modules/iobroker.mqtt-client, node: v10.19.0

So seems that publishing both ecovacs-deebot/0/consumable/# and ecovacs-deebot/0/info/battery
gets somehow disabled ("unsubscribed"?).... But why?

@tnowak
Copy link
Author

tnowak commented Mar 21, 2020

I have already found that if I manually change value within ioBroker panel (for instance: remaining filter, from 92% to 90%) then the value gets published to MQTT instantly. But they don't get published upon MQTT-client adapter restart, despite setting publish - enabled ("changes only" is not checked). And as those values change very rarely, I would need to wait long tome to get them published for the first time....

Is this a bug?
Is there a way to force publishing all mqtt-configured values?

@Pmant
Copy link
Collaborator

Pmant commented Mar 21, 2020

That is not a bug, mqtt-client should not send all states on restart, this could cause other issues. You can set the retain flag to true for this state so your MQTT Broker saves it's last value and will send it to connecting clients. For more see https://www.hivemq.com/blog/mqtt-essentials-part-8-retained-messages/

@tnowak
Copy link
Author

tnowak commented Mar 21, 2020

I have Retain flag set on all published values. But doesn't the retain flag go to MQTT with first publish command? Some values don't change much (think of brush lifespan, that changes veeeeery slowly in time). That brush lifespan value wont get published anytime soon and that's the problem.

@Pmant
Copy link
Collaborator

Pmant commented Mar 21, 2020

Yes you are right, for those values you may have to initially publish it once manually. You can re-enter it's value via ioBroker admin. An enhancement to the adapter would be to force a publish after enabling mqtt publishing for a state.

@tnowak
Copy link
Author

tnowak commented Mar 21, 2020

Could adapter publish state once (kind of "initial publish") right after it has been configured to be published (on "save" button)? That would be even more convinient and no mass publish would occur on adapter restart

@MaxWinterstein
Copy link

Could adapter publish state once (kind of "initial publish") right after it has been configured to be published (on "save" button)? That would be even more convinient and no mass publish would occur on adapter restart

This would definitely help me a lot!

@MaxWinterstein
Copy link

Note: I switched to the mqtt adapter without the -client, which has some feature like 'send all states on startup'.

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

4 participants