hbblebc / homebridge-bed-control

Homebridge plugin to control compatible smart beds
Apache License 2.0
7 stars 1 forks source link

How to show *only* occupancy sensors? #8

Closed epheterson closed 1 week ago

epheterson commented 7 months ago

I'd like to use this plugin to control automations, but not to control the bed itself. It showing up as switches/lights is unnecessary in my setup.

How can I have only the occupancy sensor appear? The example of how to hide things hides the occupancySensor and does not show the other available keys to use for hiding.

<bedId>.leftSide.occupancySensor

hbblebc commented 7 months ago

Sorry, I don't have a full list written down anywhere, that would be a good thing to add. You should be able to glean the various names from src/bedAccessory.ts, although I haven't tested disabling each device so I am not sure how effective it will be. I believe it should work though.

hbblebc commented 7 months ago

Sorry, ignore that. I haven't looked at the codebase much recently so I forgot. In src/platform.ts, around line 95 I define all the devices, you should be able to use that to turn any of them on or off using their labels.

epheterson commented 7 months ago

Thanks will give it a shot and report back, may post a complete list here if anyone finds themselves looking for the same.

hbblebc commented 7 months ago

Thanks, I appreciate it. I will update the readme with the details at some point as well, but until then, having it here would be good.

epheterson commented 7 months ago

Thanks for the tip, here's the full list that's accessible

          privacy: true,
          foundation: false,
          leftSide: {
            occupancySensor: true,
            numberControl: true,
            responsiveAir: true,
            headControl: false,
            footControl: false,
            outlet: false,
            light: false,
            footwarming: false,
          },
          rightSide: {
            occupancySensor: true,
            numberControl: true,
            responsiveAir: true,
            headControl: false,
            footControl: false,
            outlet: false,
            light: false,
            footwarming: false,
          },
          anySide: {
            occupancySensor: true,
            numberControl: false,
            responsiveAir: false,
            headControl: false,
            footControl: false,
            outlet: false,
            light: false,
            footwarming: false,
          },

Possible to disable (on by default):

          privacy: true,

          leftSide: {
            occupancySensor: true,
            numberControl: true,
            responsiveAir: true,

          rightSide: {
            occupancySensor: true,
            numberControl: true,
            responsiveAir: true,

          anySide: {
            occupancySensor: true,

Usage:

{bedID}.leftSide.numberControl
{bedID}.leftSide.responsiveAir
{bedID}.rightSide.numberControl
{bedID}.rightSide.responsiveAir
{bedID}.privacy

There is an issue when privacy is hidden, nothing shows up after that. I think because privacy mode being disabled is used to determine whether polling is possible, perhaps when it's ignored that logic isn't running properly?

My goal is to expose only occupancy sensors, and the privacy switch being there isn't ideal so I tried to hide it and saw this issue.

hbblebc commented 7 months ago

Yes, one improvement I need to make is how the privacy switch is handled. I will make sure that even if the privacy switch is hidden, the privacy state of the bed is still respected when I make those updates.

Also, the other switches will default to true as well if a base is detected, but the same principle applies for disabling them.

hbblebc commented 3 weeks ago

I have updated the readme to include the list of devices that can be ignored, and improved how the privacy switch is handled. Please give the latest update a try and let me know if you are able to successfully hide the privacy switch now. I tested it and it appears to be working as expected. Note that even with the switch hidden from the UI, the actual privacy status value will still be read from the API and used to decide if the other values should be checked or not.