Hello,
I would like to control a light with an incoming value (1-255) from an ESP8266.
I checked several examples, but I am still struggling with the automations.yaml.
The examples I found are quite different, for e.g. sometimes this is inlcuded
and sometimes not:
target:
entity_id: xyz
As a beginner this is quite confusing. Therefore I am not sure, if my issue is “only”
for processing the value for brightness or it is something else…
Can someone help me, please?
So , the payload I receive from ESP is a value between 1-255, e.g. 87.
The publisehd topic is below.
This is working, I checked it with the Mosquitto of HA.
topic: /Bathroom/Light/BRT
Here is the automations.yaml. I tried several variations of it but this seems the most suitable.
- id: '1000003'
alias: S Lampe BRT
description: ''
trigger:
- platform: mqtt
topic: /Bathroom/Light/BRT
condition: []
action:
- service: light.turn_on
data:
brightness: "{{ value_json.brightness | from_json }}"
device_id: 69c6babc1512d237ae2f374041751a0b
entity_id: light.s
domain: light
mode: single
How do I set brightness correctly?
Many thanks in advance!