Skip to content

Commit ac9661c

Browse files
committed
Allow config mqtt full topic and payload
1 parent df01031 commit ac9661c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ views:
8080
entity: sensor.zigbee2mqtt_networkmap
8181
# the following are optional:
8282
mqtt_base_topic: zigbee2mqtt # if you change base_topic of Zigbee2mqtt, change it accordingly
83+
mqtt_topic: zigbee2mqtt/bridge/request/networkmap # or you can specify the full mqtt topic, see https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messages.html#zigbee2mqtt-bridge-request
84+
mqtt_payload: { type: 'raw', routes: true }
8385
force: 3000 # decrease it to get smaller map if you have many devices
8486
node_size: 16
8587
font_size: 12

src/components/Zigbee2mqttNetworkmap.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,11 @@ export default {
164164
refresh () {
165165
this.state = 'Refreshing...'
166166
const mqttBaseTopic = this.config.mqtt_base_topic || 'zigbee2mqtt'
167+
const mqttTopic = this.config.mqtt_topic || mqttBaseTopic + '/bridge/request/networkmap'
168+
const payload = this.config.mqtt_payload || { type: 'raw', routes: true }
167169
this.hass.callService('mqtt', 'publish', {
168-
topic: mqttBaseTopic + '/bridge/request/networkmap',
169-
payload: JSON.stringify({ type: 'raw', routes: true })
170+
topic: mqttTopic,
171+
payload: JSON.stringify(payload)
170172
})
171173
},
172174
update () {

0 commit comments

Comments
 (0)