ebaauw / homebridge-soma

Homebridge Plugin for Soma Smart Shade and Soma Tilt
Apache License 2.0
13 stars 1 forks source link

Feature Request: Make Light Sensor Optional #3

Closed washcroft closed 3 years ago

washcroft commented 3 years ago

Since it's not possible to move individual services into different rooms, the solar panel "light sensor" has to stay with the blind in the room - but as this light sensor isn't real it gives a false reading for actual light in the room that you cannot get rid of.

Making this optional via config would allow users to remove it.

ebaauw commented 3 years ago

Yeah, I'll probably add some config.json settings not to expose the light sensor and/or triggers.

I did consider exposing the Current Ambient Light Level and other light sensor characteristics on the Window Covering service, so HomeKit doesn't see it as a separate sensor. Apple's Home app gets confused when both actuator and sensor services are exposed on the same accessory: it treats the services as grouped, and you cannot ungroup them. You cannot control the device directly from the tile, as Home thinks it needs to popup the window to show the different services. Of course, the sensor service doesn't show under the tile.

Alternatively, I could expose the light sensor as a separate accessory. In that case, you can also assign it to a different room. That actually makes sense, as the solar panel won't report the light level in the room, even when calibrated; it reports the outside light level.

The device actually reports the solar panel charging level, between 0 and 780 (max value I've seen so far). The Smart Shades app exposes this both as charging level and light level. I arbitrarily set Charging State to off when the value drops below 100. Afaik there's no way to tell whether the solar panel is connected, but not receiving any light vs no solar panel connected. Similarly between charger cable connected vs solar panel providing full charge level.

I understand from Wazombi Labs that there's no linear relationship between the reported value and actual light level. I've placed one of my Hue motion sensors next to the solar panel, facing outwards, to compare the reported values. Still need to write a script to log these for analysis.

washcroft commented 3 years ago

The Smart Shades app exposes this both as charging level and light level. I arbitrarily set Charging State to off when the value drops below 100.

Where do you see light level? I only see charging level.

I understand from Wazombi Labs that there's no linear relationship between the reported value and actual light level. I've placed one of my Hue motion sensors next to the solar panel, facing outwards, to compare the reported values. Still need to write a script to log these for analysis.

That'd be useful - I'd be surprised if the panel light level is accurate enough to be useful, and if it isn't then you know it's probably not worth exposing as a separate accessory (just add it on the Window Covering service for reference).

Afaik there's no way to tell whether the solar panel is connected, but not receiving any light vs no solar panel connected. Similarly between charger cable connected vs solar panel providing full charge level.

I wonder if there is a max value that would confirm whether charging via cable, a value which the solar panel could never reach?

ebaauw commented 3 years ago

Where do you see light level?

When you create or edit a trigger based on light level.

I'd be surprised if the panel light level is accurate enough to be useful

It should be useful enough for automations, based on thresholds for “dark” (which probably could also be achieved using the sunset and sunrise info), and “direct sunshine”. I want to use the latter to tilt my venetian blinds slightly to keep the sunlight out of my room, so it won’t get too warm. I have a bay window with one large window facing west, and two smaller windows facing south west and north west. I’d like the blinds to adjust themselves based on the incoming sunlight per window.

Normally, I would use on-device triggers for that, but for more advanced use cases, I need the light level in HomeKit (or another home automation system). E.g closing the blinds while watching TV, and opening them fully or slightly tilted after, depending on whether the sun shines onto the window.

I wonder if there is a max value that would confirm whether charging via cable

I think I’ve actually seen higher values using the solar panel than using the cable (connected to my mac). I haven’t compared the different devices and panels and USB chargers.

washcroft commented 3 years ago

Ah yes I see the light level reading in the app now, never noticed those triggers before.

Your use case makes sense, even if inaccurate, with a wide margin to determine "dark" or "direct sun" it can be useful to automate stuff based on that.

ebaauw commented 3 years ago

v0.0.14 no longer exposes a separate Light Sensor service. The characteristics are exposed under the Windows Covering service.

washcroft commented 3 years ago

v0.0.14 no longer exposes a separate Light Sensor service. The characteristics are exposed under the Windows Covering service.

Working perfectly, thank you :)