Giter VIP home page Giter VIP logo

Comments (5)

Louisbertelsmann avatar Louisbertelsmann commented on June 11, 2024

It could be done to set up a template to set the Meter active Power to Zero if it's got an unreasonably high value (for example if it's over 30kw.)

from sungrow-shx-inverter-modbus-home-assistant.

mkaiser avatar mkaiser commented on June 11, 2024

for me it looks like expected behaviour:

The meter is connected between grid and house wires and is powered by one 'incoming' phase from the grid.

If the grid is off, the meter does not have power. All RS485 read/write requests will return 0xFFFF FFFF. This raw value is interpreted as a signed integer, so 0x7FFF FFFF (2 147 483 647 decimal)

We could use a template sensor to check the raw value for 0x 7FFF FFFF and set the sensor to "unavailable".
It is somehow easily testable: Just switch off your circuit breakers and have a look .

It should be just 4 sensors, right? Total power and phase A-C power.

from sungrow-shx-inverter-modbus-home-assistant.

elektrinis avatar elektrinis commented on June 11, 2024

Yes I think template for this value would be the correct way to go. I'm just not sure if it should be "unavailable", or just zero. In case of blackout, zero would be closer to reality.

Yes I think it's needed for 4 sensors.

from sungrow-shx-inverter-modbus-home-assistant.

dylan09 avatar dylan09 commented on June 11, 2024

I do not use the package in the form as here in the repository. I have split it into modbus, template and helper. So I don't have to restart HA with every change.

And unfortunately not so fit with GitHub and pull requests yet. But here is my change to the sensors:

  1. I renamed the 4 modbus sensors and added a _raw to the name.
  2. as a sample for one of the sensors, here is my template sensor definition:
  - name: sg_meter_active_power
    unique_id: 20737f1c-544e-4daf-8fcb-282462c4e28a
    device_class: power
    state_class: measurement
    unit_of_measurement: W
    state: "{{ states('sensor.sg_meter_active_power_raw') | float(0) }}"
    availability: "{{ states('sensor.sg_meter_active_power_raw') | int(0) != 0x7FFFFF }}"

Sensor is unavailable in case of black-out. I think that is the best state for that case.

from sungrow-shx-inverter-modbus-home-assistant.

mkaiser avatar mkaiser commented on June 11, 2024

done in dabc6ec

thank you for the hint with the "availability" parameter. I adapted all templates to this and readability got improved :)

And unfortunately not so fit with GitHub and pull requests yet. But here is my change to the sensors:

I am still learning all this, too (svn is enough at work for my things...). Just give it a try next time - I won't bite, if something goes wrong! ;)

from sungrow-shx-inverter-modbus-home-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.