Skip to content

Advanced uses

anotherjulien edited this page Feb 18, 2023 · 1 revision

Events

CEN/CEN+ events

A powerful feature is to be able to assign CEN or CEN+ commands to your wall switches and use the events it generates in Home-Assistant to trigger automations.
CEN/CEN+ devices do not need to be configured in Home-Assistant, as all CEN/CEN+ messages received will alway trigger an event.
All you need is to create an automation with a trigger like follows:

platform: event
event_type: myhome_cenplus_event
event_data:
  event: pushbutton_short_press
  object: 33
  pushbutton: 7

or

platform: event
event_type: myhome_cen_event
event_data:
  event: pushbutton_long_release
  object: 10
  pushbutton: 1

object and pushbutton are the ones defined in the OpenWebNet CEN or CEN+ configuration. Supported events varies between CEN and CEN+:

  • CEN events:
    • pushbutton_short_press
    • pushbutton_short_release
    • pushbutton_long_press
    • pushbutton_long_release
  • CEN+ events:
    • pushbutton_short_press
    • pushbutton_long_press
    • pushbutton_long_release

This is a really useful feature, it allows you to have wall switches turn WLED strips ON and OFF; Play/Pause Skip track on your SONOS... The only limit is your imagination!

Other events

When group, area or general commands are detected, they generate events in Home Assistant.
These events can be used as triggers, so you can for instance trigger an automation when you generate a 'general off'
Example events use would be:

platform: event
event_type: myhome_area_light_event
event_data:
  area: 3
  event: 'on'

Light events

3 types of light events exist:

  • myhome_general_light_event
  • myhome_area_light_event
  • myhome_group_light_event

All events have an attribute message containing the raw OpenWebNet message and an attribute event that can be either on or off.
Area events also have an attribute area containing the area ID (the 'A' of the 'APL'); and Group events have an attribute group containing the group ID (without the leading #).

Automation (cover) events

3 types of cover events exist:

  • myhome_general_automation_event
  • myhome_area_automation_event
  • myhome_group_automation_event

All events have an attribute message containing the raw OpenWebNet message and an attribute event that can be either open, close or stop.
Area events also have an attribute area containing the area ID (the 'A' of the 'APL'); and Group events have an attribute group containing the group ID (without the leading #).

Services

Power sensor services

WHO 18 power meters are working in a way that is not always obvious. They will report the "instantaneous power consumption"; but only if requested and only for a given amount of time.
This means you will periodically need to send a specific command to ask the sensor to start sending its power consumption in real time for a given duration not exceeding 255 minutes.
This can be done with a service call on the appropriate device.

You can create an automation running on Home-Assistant's startup and every 2 hours to call this service:

service: myhome.start_sending_instant_power
data:
  duration: 125
  entity_id: sensor.general_power

Gateway services

There are very few settings that can be written to the gateway through OpenWebNet, but one of them is the current time.
You can ensure a form of time synchronization with your gateway by calling the following service on a regular basis:

service: myhome.sync_time
data: {}

This will write the current system time of your Home-Assistant instance to your gateway.

Message sending

Another more general service is used to send an arbitrary message on the bus.
It can for example be used to send general commands:

service: myhome.send_message
data:
  message: '*1*0*0##'