-
Notifications
You must be signed in to change notification settings - Fork 110
Advanced uses
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: 7or
platform: event
event_type: myhome_cen_event
event_data:
event: pushbutton_long_release
object: 10
pushbutton: 1object and pushbutton are the ones defined in the OpenWebNet CEN or CEN+ configuration.
Supported events varies between CEN and CEN+:
- CEN events:
pushbutton_short_presspushbutton_short_releasepushbutton_long_presspushbutton_long_release
- CEN+ events:
pushbutton_short_presspushbutton_long_presspushbutton_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!
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'3 types of light events exist:
myhome_general_light_eventmyhome_area_light_eventmyhome_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 #).
3 types of cover events exist:
myhome_general_automation_eventmyhome_area_automation_eventmyhome_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 #).
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_powerThere 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.
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##'When automating lights that should turn off automatically after a set duration (such as staircases, corridors, garages, or outdoor pathways), typical Home Assistant automations turn the light ON, wait using a delay: or timer helper, and then turn the light OFF.
However, relying on Home Assistant software timers has significant drawbacks:
- If Home Assistant restarts, reloads automations, or experiences network disruption while the timer is running, the turn-off command never reaches the bus and the light stays ON indefinitely.
- Software delays consume Home Assistant event loop resources and state machine tasks.
The BTicino / Legrand MyHOME bus features actuator-level timers built directly into the lighting hardware (WHO = 1). When a timed ON command is dispatched, the actuator itself takes full custody of the countdown and switches off autonomously on the SCS bus—completely immune to Home Assistant restarts or network disconnects.
OpenWebNet provides 8 native pre-set timer commands in WHO = 1:
WHAT Code |
Duration | Frame Syntax | Typical Application |
|---|---|---|---|
| 18 | 0.5 seconds | *1*18*<WHERE>## |
Door buzzer pulse, gate trigger, annunciator flash |
| 17 | 30 seconds | *1*17*<WHERE>## |
Entrance door, brief pathway courtesy light |
| 11 | 1 minute | *1*11*<WHERE>## |
Restroom, pantry, walk-through hallway |
| 12 | 2 minutes | *1*12*<WHERE>## |
Staircase, landing |
| 13 | 3 minutes | *1*13*<WHERE>## |
Garage entrance, porch light |
| 14 | 4 minutes | *1*14*<WHERE>## |
Cellar, storage room |
| 15 | 5 minutes | *1*15*<WHERE>## |
Garden walkway, basement |
| 16 | 15 minutes | *1*16*<WHERE>## |
Carport, attic, utility room |
Example: Turn ON light 21 (Area 2, Point 1) for 5 minutes:
service: myhome.send_message
data:
message: '*1*15*21##'If you require an arbitrary duration not covered by the pre-set WHAT codes, OpenWebNet allows writing Dimension 2 (Time) with hours, minutes, and seconds:
*#1*<WHERE>*#2*<HOURS>*<MINUTES>*<SECONDS>##
-
<HOURS>:0to255 -
<MINUTES>:0to59 -
<SECONDS>:0to59
Example: Turn ON light 21 for exactly 20 minutes (0 hours, 20 minutes, 0 seconds):
service: myhome.send_message
data:
message: '*#1*21*#2*0*20*0##'Example: Turn ON light 34 for 45 seconds (0 hours, 0 minutes, 45 seconds):
service: myhome.send_message
data:
message: '*#1*34*#2*0*0*45##'Here is an automation that turns ON a staircase light for 3 minutes on motion detection, delegating all timer management to the SCS bus:
alias: "Staircase Light - 3 Min Native Timer"
trigger:
- platform: state
entity_id: binary_sensor.staircase_motion
to: "on"
action:
- service: myhome.send_message
data:
message: "*1*13*21##"
mode: singleCommunity member GianlucaCh developed a dedicated custom component and blueprint that exposes a UI service myhome_timer.turn_on_timed to automatically resolve entity IDs to their bus addresses and dispatch native timers:
- GitHub Repository: GianlucaCh/Myhome-Timer
- Home Assistant Community Blueprint: MyHome Native Timer Blueprint