Sylvain
(Sylvain)
March 14, 2020, 1:10pm
1
Hi All,
I managed to add a sensor for FKB to check if motion is detected:
- platform: mqtt
name: "BRG Fully Motion"
state_topic: "fully/event/onMotion/MyDeviceID"
value_template: '{{value_json.type}}'
payload_on: visual
off_delay: 10
device_class: motion
thats cool, but I also would like to know if the screen is on. Should be simple, right? Well, perhaps. but I’m stuck :)/ The problem is that FKB reports the screen status in seperate topics for screenOn and screenOff
Screen on: MQTT message
fully/event/screenOn/MyDeviceID
{
"deviceID":"MyDeviceID"
"event":"screenOn"
}
Screen off: MQTT message
fully/event/screenOff/MyDeviceID
{
"deviceID":"MyDeviceID"
"event":"screenOff"
}
Anyone got a clue how to deal with this in Home Assistant?
It is a bit late response I know
You can use mqtt wild card
- platform: mqtt
state_topic: "fully/event/+/myDeviceID"
name: "fully_sensor"
value_template: '{{value_json.event}}'
Resulted sensor will read all events. You can process events read by fully_sensor
by a template:
- platform: template
sensors:
fully_panel_state:
friendly_name: Panel state
value_template: >-
{% if is_state_attr('sensor.fully_sensor', 'screenOn', true) %} ScreenOn
{% elif is_state_attr('sensor.fully_sensor', 'screenOff', true) %} ScreenOff
.
.
{% endif %}
Or create binary_sensor
template:
It could be even more binary_sensors feed by the sensor.fully_sensor
binary_sensor:
- platform: template
sensors:
FullyScreen:
friendly_name: "FullyScreen"
value_template: >-
{{ is_state('sensor.fully_sensor', 'screenOn') }}
Or you can skip all above and create a separate binary sensor for any event or combination of events you wish:
binary_sensor:
- platform: mqtt
name: "Screen"
payload_on: "screenOn"
payload_off: "screenOff"
state_topic: "fully/event/+/myDeviceID"
value_template: '{{value_json.event}}'
8 Likes