kellerza / sunsynk

Deye/Sunsynk Inverter Python library and Home Assistant OS Addon
https://kellerza.github.io/sunsynk/
MIT License
218 stars 91 forks source link

Grid Connected Status / grid_connected_status - Unknown sensor #41

Closed SauRoNZA closed 2 years ago

SauRoNZA commented 2 years ago

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

Grid Connected Status - grid_connected_status value appears not to be supported or working as expected.

Expected behavior

Like other sensors expect adding grid_connected_status to the configuration to populate this sensor value but it claims to be unknown.

Your environment

Logs

2022-07-04 11:20:06,234 INFO    ############################################################
2022-07-04 11:20:06,234 INFO          Unknown sensor in config: grid_connected_status
2022-07-04 11:20:06,234 INFO    ############################################################
kellerza commented 2 years ago

This should be available in the developer version of the addon.

Not sure what your usecase is, but if you simply want to check if the grid is live, you can use grid_frequency or grid_voltage

SauRoNZA commented 2 years ago

Yeah I've been using Grid Voltage via Node Red to trigger turning off non-essentials effectively and turning them back on when it's over, but due to the variable nature of it and the state not being a constant it tends to give random false triggers.

Thanks for the excellent and quite response and all your work, this Add-on probably my most used now.


Excellent, Dev did the job and super simple to switch to as well. Was worried it would make new entities.

kellerza commented 2 years ago

Great, as long as you read from the same inverter (serial number) the entities should be the same between the dev/normal addon.

you might have some issues with prefix not updating on existing entities, but that will also happen when you change the sensor prefix on the same version of the addon

I’m not sure what exactly you’ll get from this sensor though 😊 as it was added by another user and I’ve never tested it. It would be good if you can share some results

freq<40 is quite reliable. Voltage < 50 should also be…

kellerza commented 2 years ago

This is my power binary_sensor

template:
  binary_sensor:
    - name: Load shedding
      state: "{{ states('sensor.ss_grid_frequency') | default (50) | int(0) < 40  }}"
kellerza commented 2 years ago

grid_connected seems to be working. It just need a filter adjustment, probably to last, you can do it using this in your config: grid_connected_status:last image