weltmeyer / ha_sonnenbatterie

Homeassistant integration to show many stats of Sonnenbatterie
GNU General Public License v3.0
51 stars 24 forks source link

Request, not an issue - Show Operating mode #46

Closed whistlebare closed 4 months ago

whistlebare commented 4 months ago

Thanks again for your great work, i've been using your integration to change my battery's operating modes via automations and all is fine. I was wondering if there is a way of obtaining the status of the actual mode in which the battery is currently running? I'd like to add an entity to my HA so i can visually see if it is in Manual, Self consumption or TOU mode. Is that a thing already? If not how easy would that be to add? Would it be as simple as reading the current value and then setting a flag? (excuse my ignorance as i'm not a programmer in the slightest)

RustyDust commented 4 months ago

What would you like to see? A numerical representation of the operating mode or a textual one, e.g either "1", "2", "10", ... or "Self consumption", "Auto", "Time of Use" ... ? Should be fairly easy to add. Now, if you could provide some spare time ... ;)

whistlebare commented 4 months ago

I'm sorry dude...I'll sign your overtime sheet for you ๐Ÿ˜„

Personally I'd like a textual representation.

Thanks Stefan

On 27 Feb 2024 at 13:48, stefan @.***> wrote:

What would you like to see? A numerical representation of the operating mode or a textual one, e.g either "1", "2", "10", ... or "Self consumption", "Auto", "Time of Use" ... ? Should be fairly easy to add. Now, if you could provide some spare time ... ;)

โ€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sebeichholz commented 4 months ago

Perhaps this helps? I am using this as a template sensor:

- sensor:
  - name: Sonnebatterie - Betriebsmodus
    unique_id: pv_sonnen_betriebsmodus
    state: >
      {% set x = states('sensor.sonnen_status_operatingmode') | int(0) %}
      {{ {1: 'Manuell',
          2: 'Automatisch (Eigenverbrauch)',
          6: 'Modul-Erweiterung',
          10: 'Time-of-use'}.get(x, 'Unknown state') }}`
RustyDust commented 4 months ago
  {% set x = states('sensor.sonnen_status_operatingmode') | int(0) %}

Where do you get that from, I can't find that sensor in my HA. What version of the Sonnenbatterie integration are you using?

RustyDust commented 4 months ago

Something like that ok:

sb_operatingmode

?

sebeichholz commented 4 months ago

Sorry I guess this is my own REST sensor :-). I can post the config for that later

RustyDust commented 4 months ago

@whistlebare -> https://github.com/weltmeyer/ha_sonnenbatterie/pull/47

RustyDust commented 4 months ago

Sorry I guess this is my own REST sensor :-). I can post the config for that later

Won't help much since the current version of the integration doesn't provide the operating mode. So there's no way to convert it using your nifty template ;)

RustyDust commented 4 months ago

Closed by #47

whistlebare commented 4 months ago

That is perfect, thanks so much Stefan๐Ÿ‘๐Ÿผ

On 27 Feb 2024 at 14:48, stefan @.***> wrote:

Something like that ok:

sb_operatingmode.png (view on web)

?

โ€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sebeichholz commented 4 months ago

Well thank you for your effort. But I think 1 ist not "self consumption", this is 2. 1 is "manual" which means you can/must control charge/discharge manually with the REST API via /api/v2/setpoint/discharge or charge.