Closed thomasfowler closed 1 year ago
@thomasfowler I don't use this function, but here is a description for multi channel devices, please check the readme: https://github.com/AlexxIT/SonoffLAN#custom-device_class
Thanks for pointing that out. Not sure how I missed it in the docs....
For those who come across this, this was my solution that got it working:
devices:
ab30000101:
device_class: [switch, switch, switch, switch]
In my
configuration.yml
I have mydefault_class
set tolight
, as I primarily have Sonoff light switches. However, I also have a SPF controlling and monitoring some devices in my household.I would like to configure the switches on the SPM to come through as entities with the device_class
switch
rather thanlight
.Each of the light entities has the following entity_id on the SPM Sub-board:
light.sonoff_ab30000101_1
light.sonoff_ab30000101_2
light.sonoff_ab30000101_3
light.sonoff_ab30000101_4
As per the docs, in order to set the
device_class
in theconfiguration.yml
"DeviceID is always 10 symbols string from entity_id or eWeLink app."So, if I set the config as follows:
Only the first switch is now a switch entity with id
switch.sonoff_ab30000101_1
. The remaining 3 are stilllight
entities with the ids noted above.And if I use, for example,
ab30000101_1
, it is ignored.How do I configure the integration such that all 4 entities device_class is
switch
?