Add MQTT publish JSON action and subscribe JSON trigger (#193)

* Add MQTT publish JSON action and subscribe JSON trigger

* Lint
This commit is contained in:
Otto Winter
2018-10-20 12:41:00 +02:00
committed by GitHub
parent 81bc400340
commit 629f2b128e
11 changed files with 233 additions and 140 deletions

View File

@@ -76,7 +76,14 @@ sensor:
- platform: mqtt_subscribe
name: "MQTT Subscribe Sensor 1"
topic: "mqtt/topic"
id: the_sensor
qos: 2
on_value:
- mqtt.publish_json:
topic: the/topic
payload: |-
root["key"] = id(the_sensor).value;
root["greeting"] = "Hello World";
- platform: cse7766
voltage:
name: "CSE7766 Voltage"