WTH don't we have Event Binary Sensors?

that’s the thing, the binary_sensor + trigger doesn’t exist.
If you read the thread you’d see that people are describing how they would use it if it was supported

Template sensors and binary sensors now allow attaching triggers for updates in Home Assistant 2021.5.

template:
  trigger:
    platform: event
    event_type: my_event
  binary_sensor:
    - name: Event recently fired
      auto_off: 5
      state: "true"

Screenshot 2021-04-30 at 09.54.19

3 Likes

This example should be in the doc you linked to. The example that is there is confusing, this one is much better.

I linked to the current documentation but that obviously doesn’t have the new stuff in it yet (this is not released). See docs of next release at Template - Home Assistant

That sequence can be made much simpler.
Since (I assume) the device is in the message then you can use that in the call service node as a variable.

is deprecation of the ‘old’ way of configuring template sensors on the roadmap at all?

I ask because we can now list all binary_sensors, regardless of their platform under that key, and this new way would brake that beauty.
And, even if not planned to deprecate, would there be an advantage at all in rewriting all current template sensors to the new platform template: ?

No plans to remove it.

Not sure what you mean with sensors of all platforms under that key.

thanks.

I meant under the key binary_sensor: we can do this now in a package:

binary_sensor:

  - platform: template
    sensors:
      sensor.xx

  - platform: command_line
    name: Mobile reachable
    command: !secret mobile_command

  - platform: mqtt
    name: Audio Auditorium
    state_topic: 'topic/id/state'
    payload_on: 'on'
    payload_off: 'off'

  - platform: sun2
    entity_namespace: astral
    monitored_conditions:
      - elevation:
          above: -18

  - platform: workday
    country: NL
    name: Workday

  - platform: stookalert
    province: Noord-Brabant
    name: Stookalert Brabant

  - platform: meteoalarm
    name: Meteoalarm Brabant
    country: 'NL'
    language: ne
    province: Noord-Brabant

  - platform: ping
    host: 192.168.1.150
    name: iPhone

  - platform: trend
    sensors:

      temp_falling:
        friendly_name: Temp falling
        entity_id: sensor.temp_current
etc etc

and taking out the binary template sensor and create a dedicated template: for all sensors using a template breaks that beauty.
It seems to shift focus from the ‘message’ (is it on or not) to the ‘means’ (how does it establish if its on or not), which shouldn’t be the main point of interest?

btw, in the above example, no template is used at all, so why is this even a trigger based template? it is trigger based, which is in fact the new and very welcome platform. Why not list is as such in the config and docs as its own platform?

2 posts were split to a new topic: Splitting up the template integration

Now that we have event sensors, closing before more support arrives. Create new topics in Configuration with support questions. Thanks.