Hi
i have got a LED, a motion sensor und a brightness sensor.
The LED tunrs on when motion is detected.
I want the brightness of the LED to be dependend on the brightness sensor.
(255 - brightness sensor)
examples:
- Motion detected, Brighness: 255, LED brightness: 0
- Motion detected, Brighness 155, LED brighness 100
LED:
light:
- platform: mqtt
name: "dev_led"
state_topic: "dev/1/dev_led/state/power"
command_topic: "dev/1/dev_led/command/power"
brightness_state_topic: "dev/1/dev_led/state/brightness"
brightness_command_topic: "dev/1/dev_led/command/brightness"
brightness_scale: 255
qos: 0
payload_on: "1"
payload_off: "0"
optimistic: false
Motion
binary_sensor:
platform: mqtt
state_topic: "dev/1/motion"
name: "arbeitszimmer_motion"
qos: 0
payload_on: "on"
payload_off: "off"
Brightness (Potentiometer for testing)
- platform: mqtt
state_topic: "dev/1/pot"
name: "pot"
unit_of_measurement: ""
Automation
- alias: "Hallway Motion"
trigger:
platform: state
entity_id: binary_sensor.arbeitszimmer_motion
to: 'on'
action:
service: homeassistant.turn_on
entity_id:
- light.dev_led
- alias: "Hallway Timer"
trigger:
platform: state
entity_id: binary_sensor.arbeitszimmer_motion
to: "off"
for:
seconds: 10
action:
service: homeassistant.turn_off
entity_id: light.dev_led
I want something like this:
- alias: "Hallway Motion"
trigger:
platform: state
entity_id: binary_sensor.arbeitszimmer_motion
to: 'on'
action:
service: light.turn_on
entity_id:
- light.dev_led
data:
brightness: sensor.pot