Sensor to Light Switch remapping
350d opened this issue · 5 comments
Describe the idea or improvement
There is a clever solution available to use window/door sensor as smart light switch where some alias workaround needed to convert sensor to switch. Home Assistant example:
- alias: Light switch
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
action:
service: light.toggle
entity_id: light.somelight
Describe the solution you'd like
Is there any options already available to do that with this plugin or additional development needed?
Additional context
No context.
Hi,
interesting to use of the sensors😅 I understand using the sensor as a trigger to turn on off a light switch is not possible hence this hack?
I do not think that it is possible currently, but I mean you could try to manually specify the device model and use properly monitor or control to expose the properties which you want. The thing is that probably the properties will not match between the real or fake device, but you could try that out anyway...
Please read the README, all the information which you need is there!
I already did, but it's way out of my knowledge in this area. Any examples available for remapping one device type to another? Appreciate your help here.
Sensor details:
NAME: Light switch Virtual
ID: lumi.158d00016cd97a
MODEL: lumi.sensor_magnet.v2
PROPS:
magnet-sensor:contact-state
EVENTS:
magnet-sensor:close
magnet-sensor:open
magnet-sensor:door-not-closed
battery:low-battery
You have to specify the device type manually in the config. That will be used to create the accessory. Afterwards, as the properties will it match between what you specified and the actual device, you should propertyMonitor or propertyControl to configure the device. All the info on how to do that is in the README.
You have to also access the miot spec for your device to see what properties are there.