@thanksmister wrote:
I am trying to set my HUE light bulbs from an mqtt automation trigger. I am sending the payload as JSON and trying to parse the json using the service_template and data_template to set the light entity state and brightness.
I am not using the light component because my purpose is a little more complicated, I have an Android application that is talking with HASS through MQTT and I want to control a dimmer light connected to HASS from the application.
This is the JSON I am sending as the payload:
{'topic':'room/dimmer/set', 'payload': '{"state":"on", "brightness":10}'}
Here is my automation:
- id: '1577995477209' alias: MQTT Dimmer description: '' trigger: - platform: mqtt topic: room/dimmer/set condition: [] action: - data_template: brightness: '{{ trigger.payload_json.brightness }}' entity_id: light.living_room service_template: > light.turn_{{ trigger.payload_json.state }}
Nothing is happening of course, but is there a way to test this with the dev tools or if anyone has something similar they would share.
Posts: 3
Participants: 2