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

Is it possible to update the MQTT topics and message structure? #1075

Closed
antti365 opened this issue Feb 12, 2019 · 11 comments
Closed

Is it possible to update the MQTT topics and message structure? #1075

antti365 opened this issue Feb 12, 2019 · 11 comments

Comments

@antti365
Copy link
Contributor

antti365 commented Feb 12, 2019

  1. I make the control panel in the node-red dashboard and the zigbee2mqtt/bridge/log topic. In my opinion, I’m missing several options, is it possible to add them?
    Something like this ...
  • device_renamed
  • device_binding
  • device_add_group, device_remove_group, device_remove_all_group
  1. Also, if possible, I would like to see in the output of the topic zigbee2mqtt/bridge/log "devices": a list of all devices with a battery value for all devices that transmit this parameter.

  2. And finally, at the start of the bridge, he could report in a certain topic about the state permit_join and log_level.

I would be very grateful for the help in adding these new options.

Update:
4. Another would be to add the setting of the parameters last_seen and elapsed through mqtt.

Koenkk added a commit that referenced this issue Feb 13, 2019
@Koenkk
Copy link
Owner

Koenkk commented Feb 13, 2019

  1. Done
  2. This can already be retrieved, subscribe to zigbee2mqtt/+ and parse the battery out of the payloads
  3. Done
  4. Same as 2

Documentation: https://github.com/Koenkk/zigbee2mqtt.io/blob/dev/information/mqtt_topics_and_message_structure.md

@antti365
Copy link
Contributor Author

antti365 commented Feb 13, 2019

@Koenkk On the first three points everything is fine, thank you very much!
On the fourth point, I probably incorrectly explained - is it possible to make it so that they can be changed via MQTT, as well as, for example, friendly_name, on the fly?

@antti365
Copy link
Contributor Author

@Koenkk Are we closing this issue or can something be done on the last post?

@Koenkk
Copy link
Owner

Koenkk commented Feb 17, 2019

I will look into the last, should be doable.

@Koenkk
Copy link
Owner

Koenkk commented Feb 18, 2019

Added last_seen, adding more should be easy, just apply the same changes as in 26bed2d.

Koenkk added a commit to Koenkk/zigbee2mqtt.io that referenced this issue Feb 18, 2019
@antti365
Copy link
Contributor Author

@Koenkk Great, thanks, I figured out where to add this. I think this can be closed Issue.

@antti365 antti365 reopened this Feb 23, 2019
@antti365
Copy link
Contributor Author

@Koenkk Hurried up, changing last_seen via mqtt works correctly with the Ikea switch, but the disable command is not perceived as a dimmer.
Feb 23 16:15:45 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:15:45 PM Set last_seen to epoch
Feb 23 16:16:14 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:16:14 PM MQTT publish: topic 'zigbee2mqtt/Ikea_Switch', payload '{"battery":74,"linkquality":63,"elapsed":151492,"click":"off","last_seen":1550931374726}'
Feb 23 16:16:20 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:16:20 PM MQTT publish: topic 'zigbee2mqtt/Ikea_Dimmer', payload '{"battery":74,"linkquality":0,"last_seen":1550931380967,"brightness":0,"elapsed":47858}'

Feb 23 16:16:48 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:16:48 PM Set last_seen to ISO_8601
Feb 23 16:16:51 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:16:51 PM MQTT publish: topic 'zigbee2mqtt/Ikea_Switch', payload '{"battery":74,"linkquality":63,"elapsed":36541,"click":"off","last_seen":"2019-02-23T14:16:51.267Z"}'
Feb 23 16:16:54 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:16:54 PM MQTT publish: topic 'zigbee2mqtt/Ikea_Dimmer', payload '{"battery":74,"linkquality":31,"last_seen":"2019-02-23T14:16:54.081Z","brightness":0,"elapsed":17280}'

Feb 23 16:17:01 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:17:01 PM Set last_seen to disable
Feb 23 16:17:05 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:17:05 PM MQTT publish: topic 'zigbee2mqtt/Ikea_Switch', payload '{"battery":74,"linkquality":57,"elapsed":14471,"click":"off"}'
Feb 23 16:17:11 raspberrypi3 npm[32239]: zigbee2mqtt:info 2/23/2019, 4:17:11 PM MQTT publish: topic 'zigbee2mqtt/Ikea_Dimmer', payload '{"battery":74,"linkquality":31,"last_seen":"2019-02-23T14:16:54.081Z","brightness":0,"elapsed":17110}'

@Koenkk
Copy link
Owner

Koenkk commented Feb 23, 2019

Can you check with the latest dev branch?

@antti365
Copy link
Contributor Author

@Koenkk Thank you very much, now everything works as it should!

@antti365 antti365 reopened this Mar 7, 2019
@antti365
Copy link
Contributor Author

antti365 commented Mar 7, 2019

@Koenkk I tried to change the above files for the elapsed option. It did not work, in the logs the change record appears, in the configuration file the option appears in quotes for some reason (elapsed: ‘false’), and the sensors now send the same value all the time ...
Your help is needed. :)

@Koenkk
Copy link
Owner

Koenkk commented Mar 7, 2019

@antti365 please make a PR with the changes you made (doesn't have to be working), we will continue there.

@Koenkk Koenkk closed this as completed Mar 7, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
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