datMaffin / homebridge-tesla-powerwall

Homebridge Plugin for the Tesla Powerwall
ISC License
21 stars 11 forks source link

Consider a contact sensor type for grid up/down? #19

Closed mikeknoop closed 3 years ago

mikeknoop commented 4 years ago

Great plugin, thank you for creating it!

A suggestion to consider. Homekit has built-in notifications for sensor states changing but not switches. I'd like to get native notifications when the grid goes down (as well as automating a few things). In homekit, sensors can be used to trigger automation just like switches can. Consider swapping out the switch accessories for the "grid up/down" service with a contact sensor (or two) that are set to open/closed when the circuit is. A nice bonus is the mental mapping between "open circuit" and "open contact sensor" for electronics :)

datMaffin commented 4 years ago

Ok, I implemented the contact sensors as additional services. It is published to npm as @1.1.0-Beta2 (https://www.npmjs.com/package/homebridge-tesla-powerwall/v/1.1.0-Beta2) To enable the sensors it is required to set the following fields in the config.json in the subsection additionalServices.gridstatus to true:

"gridIsDownSensor": true,
"gridIsUpSensor": true

It would be great if you could report back whether everything works as expected.

datMaffin commented 4 years ago

Fixed a minor issue. Please use @1.1.0-Beta3 (https://www.npmjs.com/package/homebridge-tesla-powerwall/v/1.1.0-Beta3)

mikeknoop commented 4 years ago

Confirmed, it is working! Appreciate the support.

image

jlaska commented 3 years ago

With @1.1.0-Beta3 and @1.1.0-Beta2 I’m not seeing the new sensors. I have the following config.json settings:


        {
            "platform": "TeslaPowerwall",
            "name": "Tesla Powerwall",
            "ip": "192.168.0.10",
            "additionalServices": {
                "gridstatus": {
                    "gridIsDownSensor": true,
                    "gridIsUpSensor": true
                }
            }
        }

no obvious errors in the homebridge.log. Is there something I’m missing?

jlaska commented 3 years ago

Please disregard previous post. I forgot sensors display differently in iOS 14. Looks good! Thank you.

69EF3B98-5CAE-444D-A2F0-7E977256FF82

datMaffin commented 3 years ago

Please disregard previous post. I forgot sensors display differently in iOS 14. Looks good! Thank you.

No problem 😉