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

Publish only on change not working #451

Open
rubenvw-ngdata opened this issue May 31, 2024 · 12 comments
Open

Publish only on change not working #451

rubenvw-ngdata opened this issue May 31, 2024 · 12 comments
Labels

Comments

@rubenvw-ngdata
Copy link

Describe the bug
I have mqtt configured on ioBroker for certain objects:
image
When I enable 'publish own states on commect' and save the configuration, I get the state for these objects.
But if an object value changes, I do not get an update, even while I have 'publish only on change' enabled. In ioBroker Objects, I can see the value changing, but on the mqtt server I do not receive anything.

Expected behavior
A publish for every time the value changes.

Screenshots & Logfiles
I use the loxone mqtt server. Can share more details if needed.

Versions:

@Apollon77
Copy link
Contributor

Please provoide an debug log of such a case and tell which value changed that was not send out. Please also enable the extended debug in settings

@rubenvw-ngdata
Copy link
Author

rubenvw-ngdata commented May 31, 2024

Do you want me to enable 'Trace output for every message' or where can I find the debug configuration?
image
this is an example state I see changing, but for which I do not see anything in mqtt

It only publishes state when I save the configuration
image
but not when one of these values changes

@Apollon77
Copy link
Contributor

Yes the trace output is what I mean. And enable debug log please (expertmode enable, instances, expand mqtt.X and set loglevel to debug. Then get the log from file on disk in /opt/iobroker/log . tell example names and such that log can be searched for

@rubenvw-ngdata
Copy link
Author

rubenvw-ngdata commented Jun 1, 2024

In the logs I can see the state changes now:
The state I am changing is mihome-vacuum.0.info.state (from 8 to 5 and back to 8 over some other states)

2024-06-01 17:08:10.439  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mihome-vacuum.0.info.state: {"val":8,"ack":true,"ts":1717254490433,"q":0,"from":"system.adapter.mihome-vacuum.0","user":"system.user.admin","lc":1717254418349}
2024-06-01 17:08:12.749  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value: {"val":"off","ack":true,"ts":1717254492743,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717254392743}
2024-06-01 17:08:13.337  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value: {"val":"art","ack":true,"ts":1717254493332,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717157347934}
2024-06-01 17:08:16.029  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/pollms" (number): 5.83
2024-06-01 17:08:16.046  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mqtt.0.loxberry.mqttgateway.pollms: {"val":5.83,"ack":true,"ts":1717254496040,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1717254496040}
2024-06-01 17:08:16.048  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/pollcpucurpct" (number): 4.5
2024-06-01 17:08:16.066  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received (but ignored) "loxberry/mqttgateway/pollcpumaxpct" (number): 4.5
2024-06-01 17:08:16.083  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mqtt.0.loxberry.mqttgateway.pollcpucurpct: {"val":4.5,"ack":true,"ts":1717254496077,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1717254496077}
2024-06-01 17:08:16.085  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/pollpidvalpct" (number): -0.1
2024-06-01 17:08:16.102  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/pollproccnt" (number): 167
2024-06-01 17:08:16.114  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mqtt.0.loxberry.mqttgateway.pollpidvalpct: {"val":-0.1,"ack":true,"ts":1717254496107,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1717254496107}
2024-06-01 17:08:16.120  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/keepaliveepoch" (number): 1717254496
2024-06-01 17:08:16.128  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mqtt.0.loxberry.mqttgateway.pollproccnt: {"val":167,"ack":true,"ts":1717254496117,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1717254496117}
2024-06-01 17:08:16.182  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mqtt.0.loxberry.mqttgateway.keepaliveepoch: {"val":1717254496,"ack":true,"ts":1717254496177,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1717254496177}
2024-06-01 17:08:20.765  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mihome-vacuum.0.info.state: {"val":8,"ack":true,"ts":1717254500750,"q":0,"from":"system.adapter.mihome-vacuum.0","user":"system.user.admin","lc":1717254418349}
2024-06-01 17:08:22.740  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value: {"val":"off","ack":true,"ts":1717254502732,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717254392743}
2024-06-01 17:08:23.185  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value: {"val":"art","ack":true,"ts":1717254503181,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717157347934}
2024-06-01 17:08:31.041  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mihome-vacuum.0.info.state: {"val":8,"ack":true,"ts":1717254511027,"q":0,"from":"system.adapter.mihome-vacuum.0","user":"system.user.admin","lc":1717254418349}
2024-06-01 17:08:32.705  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value: {"val":"off","ack":true,"ts":1717254512701,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717254392743}
2024-06-01 17:08:33.214  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value: {"val":"art","ack":true,"ts":1717254513209,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717157347934}
2024-06-01 17:08:41.386  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mihome-vacuum.0.info.state: {"val":5,"ack":true,"ts":1717254521369,"q":0,"from":"system.adapter.mihome-vacuum.0","user":"system.user.admin","lc":1717254521369}
2024-06-01 17:08:42.715  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value: {"val":"off","ack":true,"ts":1717254522709,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717254392743}
2024-06-01 17:08:43.303  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value: {"val":"art","ack":true,"ts":1717254523298,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717157347934}
2024-06-01 17:08:51.696  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mihome-vacuum.0.info.state: {"val":6,"ack":true,"ts":1717254531676,"q":0,"from":"system.adapter.mihome-vacuum.0","user":"system.user.admin","lc":1717254531676}
2024-06-01 17:08:52.723  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value: {"val":"off","ack":true,"ts":1717254532717,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717254392743}
2024-06-01 17:08:53.320  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value: {"val":"art","ack":true,"ts":1717254533315,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717157347934}
2024-06-01 17:09:01.985  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange mihome-vacuum.0.info.state: {"val":6,"ack":true,"ts":1717254541974,"q":0,"from":"system.adapter.mihome-vacuum.0","user":"system.user.admin","lc":1717254531676}
2024-06-01 17:09:02.768  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value: {"val":"off","ack":true,"ts":1717254542763,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717254392743}
2024-06-01 17:09:03.373  - ESC[34mdebugESC[39m: mqtt.0 (267530) stateChange smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value: {"val":"art","ack":true,"ts":1717254543366,"q":0,"from":"system.adapter.smartthings.0","user":"system.user.admin","lc":1717157347934}

But only at startup it sends out the states:

2024-06-01 17:07:56.818  - ESC[32minfoESC[39m: mqtt.0 (267530) starting. Version 5.2.0 in /opt/iobroker/node_modules/iobroker.mqtt, node: v18.20.3, js-controller: 5.0.19
2024-06-01 17:07:57.323  - ESC[32minfoESC[39m: mqtt.0 (267530) Try to connect to mqtt://192.168.1.32:1883 with clientId=iobroker.mqtt.0and credentials loxberry:*******************
2024-06-01 17:07:57.494  - ESC[32minfoESC[39m: mqtt.0 (267530) Connected to 192.168.1.32
2024-06-01 17:07:57.499  - ESC[32minfoESC[39m: mqtt.0 (267530) Subscribe on "#"
2024-06-01 17:07:57.506  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.info.connection
2024-06-01 17:07:57.508  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.status
2024-06-01 17:07:57.509  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.keepaliveepoch
2024-06-01 17:07:57.510  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.weather4lox.plugin.lastupdate_epoche
2024-06-01 17:07:57.510  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.pollms
2024-06-01 17:07:57.511  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.pollcpucurpct
2024-06-01 17:07:57.512  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.pollcpumaxpct
2024-06-01 17:07:57.513  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.pollpidvalpct
2024-06-01 17:07:57.513  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.mqttgateway.pollproccnt
2024-06-01 17:07:57.514  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.LoxBerry_Version
2024-06-01 17:07:57.514  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Linux_Kernel
2024-06-01 17:07:57.514  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.System_Architecture
2024-06-01 17:07:57.515  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.CPU_Temperature
2024-06-01 17:07:57.515  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Voltage
2024-06-01 17:07:57.515  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.RootFS
2024-06-01 17:07:57.516  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.RootFS_free_space
2024-06-01 17:07:57.516  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.RAMDiscs_free_space
2024-06-01 17:07:57.516  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.System_Load
2024-06-01 17:07:57.516  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Log_Database
2024-06-01 17:07:57.534  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Notification_Database
2024-06-01 17:07:57.536  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Miniserver_Access
2024-06-01 17:07:57.537  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Reboot_required
2024-06-01 17:07:57.538  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.MQTT
2024-06-01 17:07:57.538  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.Plugin_Loglevels
2024-06-01 17:07:57.538  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mqtt.0.loxberry.healthcheck.summary
2024-06-01 17:07:57.538  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state mihome-vacuum.0.info.state
2024-06-01 17:07:57.539  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.switch.switch.value
2024-06-01 17:07:57.539  - ESC[32minfoESC[39m: mqtt.0 (267530) Publishing state smartthings.0.a5b69daf-3532-ea09-207c-92537d82644a.status.tvChannel.tvChannelName.value
2024-06-01 17:07:57.585  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/status" (object): Connected
2024-06-01 17:07:57.588  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/mqttgateway/keepaliveepoch" (object): 1717254435
2024-06-01 17:07:57.589  - ESC[34mdebugESC[39m: mqtt.0 (267530) Client received "loxberry/healthcheck/LoxBerry Version" (object): {"status":"5","statustext":"OK","result":"Current Version: 3.0.1.2 / No newer Release available."}

@rubenvw-ngdata
Copy link
Author

@Apollon77 Do you already have an idea why the messages are not being published? Do you need any more information?

@rubenvw-ngdata
Copy link
Author

any update on this ticket?

@rubenvw-ngdata
Copy link
Author

This seems like some very basic functionality that is not working as expected. Can anyone help me out finding the cause? This might be a misconfiguration?

@Apollon77
Copy link
Contributor

Please show your config. There should be one setting if just "ack=false" ones (so commands) are sent ... if this is enabled then it is clear that changes with ack=true are not sent out

@rubenvw-ngdata
Copy link
Author

This is the configuration:
image

@Apollon77
Copy link
Contributor

Send state (Ack=true) toois not activated ... so why the adapter should send those updates? Activate it ... does it work then?

@rubenvw-ngdata
Copy link
Author

Based on your comment I had already tried that. With that change it seems to work for the vacuum state, but not for smartthings changes (the tv).

@Apollon77
Copy link
Contributor

Then enable please and send a new debug log showing this case

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

No branches or pull requests

2 participants