Reference documentation

glitchhound's Avatar Topic Author
User User
  • Posts: 6
  • Thanks: 0

Reference documentation

1 week 3 days ago
#5169
Hi folks,

Been going through attempts to set up my SmartRemote and I feel like I keep hitting walls. Docs links are currently broken, which doesn't help, but even docs I find which might be useful seem quite incomplete once I get to them (latest example: there's a doc page on MQTT use which doesn't actually have any details on publishing, subscribing, connecting, or hosting...)

The driver command tester helps a lot for devices supported via drivers, but the macro editor doesn't seem to provide any assistance with authoring anything more advanced than a sequence of commands.

Is there any reference documentation available? Things like:
- a command reference for authoring macros
- an API reference (I see that there's apparently a way to trigger commands... maybe macros too, via API but the only information is indirect like in a brief document on IFTTT or random forum threads. What does that command look like? Is there a command to get and/or set server variables? Trigger automaions? etc)

At risk of making a forum topic that goes in too many directions, I've seen threads suggesting that there are MQTTPublish and MQTTSubscribe commands but I don't know where to learn their syntax and expected parameters - there doesn't appear to be any MQTT-related driver so there's no command tester that will help me discover it. These are the kinds of things that it would be really helpful to have a reference for.

Please Log in or Create an account to join the conversation.

glitchhound's Avatar Topic Author
User User
  • Posts: 6
  • Thanks: 0

Re: Reference documentation

1 week 3 days ago
#5170
Well I just finally clicked the Wizard button in the dashboard and now found the equivalent of the Driver command tester command builder for server commands...

That said, I'm still curious if there exists or can be generated a list of all such things. Even just an export of whatever data structure informs the command builders would be useful nowadays as it could be provided to an AI agent to help.

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 352
  • Thanks: 28

Re: Reference documentation

1 week 3 days ago - 1 week 3 days ago
#5171
I'll leave Allonis to comment on the documentation but here are some commands I've used:

An automation to switch off a charger when the device is charged:

Code:
WHEN: {{zigbee2mqtt_chargerpower}} Changes Value AND: {{zigbee2mqtt_chargerpower}} < 0.006 MqttPublish|zigbee2mqtt/Charger/set~off


Automation to copy the on/off state of the main kitchen light to an under-cupboard LED strip:

Code:
WHEN: {{zigbee2mqtt_kitchen_switchstate}} Changes Value MqttPublish|zigbee2mqtt/Kitchen_LED_strip/set~{{zigbee2mqtt_kitchen_switchstate}}



Macro to turn on the bedroom light:

Code:
Macro| MqttPublish|zigbee2mqtt/Bedroom_light/set~{"state": "ON"} ​​​​​​​
Last edit: 1 week 3 days ago by andrew.

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 352
  • Thanks: 28

Re: Reference documentation

1 week 2 days ago
#5172
It was a while ago but I think I turned on the mqtt broker on port 1883 in myServer (from the main home page of the dashboard). Then set up a Mosquitto mqtt broker on a separate server. Configured that to bridge to the myServer broker. And I've also got Zigbee2mqtt running connected to my Mosquitto server. Any mesages that come in to the myServer broker seem to create server variables as can be seen in my examples above. I can't remember why I didn't just connect Zigbee2mqtt straight to the myServer broker - must have been something to do with other applications wanting to use mqtt or something like that.

Please Log in or Create an account to join the conversation.

glitchhound's Avatar Topic Author
User User
  • Posts: 6
  • Thanks: 0

Re: Reference documentation

1 week 2 days ago
#5173
Thanks @andrew!

I have MQTT on HomeAssistant. Unfortunately myServer's subscribe doesn't support username/password authentication, and the default MQTT on HA has eliminated anonymous interaction. I found some options and got it working but then the MQTTPublish command is only able to publish to myServer's broker. For now I'm not blocked, I just thought I would share this in case any of it jogs memory as to why you settled on your approach.

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 352
  • Thanks: 28

Re: Reference documentation

1 week 1 day ago - 1 week 1 day ago
#5174
It might be as simple as I had Mosquitto running before starting to use myServer, as I've been playing with Node-RED for a long time. Then as you say it seems myServer can only publish to itself, so I had to get messages from my existing mqtt system into myServer and bridging seemed to be the way to do it. I don't know much about any of this stuff - just enough to be dangerous...
Last edit: 1 week 1 day ago by andrew.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds