-
Notifications
You must be signed in to change notification settings - Fork 18
Examples
Unfold to see this content
Your device ID should be indicated on your device.
But no panic if you can't find it on your device, you can use HA_enoceanmqtt to find it.
- Open the log of HA_enoceanmqtt
- Make some action on your device, for example, press one button if it is a rocker, press the learn button of your device, etc.
- You will have a new input in the log file looking like (If you use the addon, press the refresh button):
2022-11-13 11:49:47,193 INFO: received: 01:23:45:67->FF:FF:FF:FF (-77 dBm): 0x01 ['0xf6', '0x30', '0x1', '0x23', '0x45', '0x67', '0x30'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x4d', '0x0'] OrderedDict() 2022-11-13 11:49:47,195 INFO: unknown sensor: 01:23:45:67
You can then use this address to add your device in the device file:
[my_new_device] address = 0x01234567 rorg = <your_device_rorg> func = <your_device_func> type = <your_device_type>
Voilà !
Unfold to see this content
As I don't have access to all EnOcean devices, I organized HA_enoceanmqtt so that end-users can do field tests when requesting a new device support or add new device support themselves. For that, it requires modifying the mapping.yaml file and maybe also the EEP.xml file used by the EnOcean library.
This procedure is for addon users as standalone and docker users can have direct access to these files. Here are the steps to follow:
- First stop the addon.
- If needed, get inspired by the default mapping.yaml, then copy your
mapping.yaml
file to your home assistant/config/<directory_you_want>/mapping.yaml
. Note that/config/
is the directory where you have your Home Assistantconfiguration.yaml
file. - Then in the addon configuration tab, you have a configuration entry named
mapping_file
. Set this entry to/config/<directory_you_want>/mapping.yaml
, which is the location where you saved the mapping.yaml file and save your configuration. Leave this entry empty if not needed. - Similarly, for the
EEP.xml
file, if needed, get inspired by the default one and then copy it to your home assistant/config/<directory_you_want>/EEP.xml
. Note that/config/
is the directory where you have your Home Assistantconfiguration.yaml
file. - Again, in the addon configuration tab, you have a configuration entry named
eep_file
. Set this entry to/config/<directory_you_want>/EEP.xml
, which is the location where you saved the EEP.xml file and save your configuration. Leave this entry empty if not needed. - Finally, restart the addon.
After that you should see your modifications applied to the corresponding entities in HA.
Unfold to see this content
This is from the excellent post by @tbarbette in mak-gitdev/ha_enoceanmqtt#16 (https://github.com/mak-gitdev/HA_enoceanmqtt/discussions/16#discussioncomment-6281088).
I've got the exact same setup.
First launch the enoceanmqtt with the default enoceanmqtt.conf correctly configured but don't bother adding buttons or else. The idea is to recover the baseid of your USB300 in the MQTT integration.
You'll have normally one device, look for that :
And get the base id there :
Then, with the base ID you can invent some sender IDs to create virtual switch buttons, exactly like the physical ones you probably have. Add the following for each light (yes, it will be long). My base id is 0xFFEDA9XX. I used the number of my relays as last digits.
[relay/PorchLight]
address = 0xFFFFFFFF
sender = 0xFFEDA921
rorg = 0xF6
func = 0x02
type = 0x01
virtual = 1
Then, the button will appear in Home Assistant.
A0, A1, B0, B1 are basically like pressing the 4 buttons of the physical switches. You can start the learning process on your F4SR14-LED like the physical switches, one by one. Yes it's long and painful.
Basically now it should work, but the buttons are not very convenient... So what you want is to create virtual "template" switch. But first, for those button to reflect the state of your light, you want also to integrate the feedback from the FAM14. After actionning each interruptor (virtual or physical), you'll get a message in "response" to the switch being pressed in the enoceanmqtt log.
Why? Even if you manage to record the state when you interact with relays from HA, the physical buttons are still there and you want their feedback too.
Create "state" entities in enoceanmqtt.conf with the address, one by one:
[relay_state/Porch]
rorg = 0xf6
func = 0x02
type = 0x01
address = 0xFFE80D01
The funny part is that it's the same device type. The reason is the FAM14 basically echo the datagram with the current state of the relay. So it appears as a switch... But it actually reflects the state of the relay :)
Okay, you get the "actioner", and the "state", let's build a nice button out of that :
switch:
- platform: template
switches:
porch_light:
friendly_name: Porch power
value_template: "{{ is_state('binary_sensor.e2m_relay_state_porch_bo_pressed', 'on') }}"
turn_on:
- service: select.select_option
data:
option: AO
target:
entity_id: select.e2m_relay_porchlight_action
turn_off:
- service: select.select_option
data:
option: AI
target:
entity_id: select.e2m_relay_porchlight_action
And tadaaam :
A bit painfull to create 24 relays, but once done it works like a charm :)