wutu / pimatic-mqtt

MQTT plugin for Pimatic
https://pimatic.org/plugins/pimatic-mqtt/
GNU Affero General Public License v3.0
9 stars 13 forks source link

Can't send json string #22

Closed ManuelW77 closed 7 years ago

ManuelW77 commented 7 years ago

hey there,

it wont work to send some json string with a rule. I try'd this

"rule": "when every 15 seconds then publish mqtt message \"{\"cpu\":$plex-systeminfo.cpu,\"memory\":$plex-systeminfo.memory}\" on topic \"pimaticAZ/system\""

and this

"rule": "when every 15 seconds then publish mqtt message \"{cpu:$plex-systeminfo.cpu,memory:$plex-systeminfo.memory}\" on topic \"pimaticAZ/system\""

and some other constalations, but i can't get it work to send a json string.

Can you help me with this?

ManuelW77 commented 7 years ago

Hmpf, i get it work, got a light on my head when i send this.

"rule": "when every 15 seconds then publish mqtt message \"{\"cpu\":$plex-systeminfo.cpu,\"memory\":$plex-systeminfo.memory}\" on topic \"pimaticAZ/system\""

wutu commented 7 years ago

Hey, it is necessary to escape quotes and angle brackets. For example:

publish mqtt message "\{\"series\":20\}" on topic "/outbox/pimatic/RootDisk"