pablozg / freeds

Derivador de energía solar excedente
GNU General Public License v3.0
98 stars 34 forks source link

Homeassistant #21

Open tfael opened 3 years ago

tfael commented 3 years ago

Hola, algún plan de desarrollar una integración en Homeassistant?

pablozg commented 3 years ago

Hola, en estos momentos estoy liado con temas de trabajo y estoy ultimando la última versión que voy a publicar antes de centrarme en el trabajo y serán unos dos o tres meses en los que sólo tocaré el proyecto para temas urgentes.

Respecto a HA no creo que vaya a desarrollar ninguna implementación a no ser que alguien lo haga por su cuenta, ya que uso Domoticz en su lugar y como te digo ahora mismo no tengo demasiado tiempo libre, pero te animo a que lo intentes tú directamente.

Un saludo.

jorgestima commented 2 years ago

I'm also using HA and indeed, it would be great to have some integration. For example, if just two things were possible to integrate in HA as ON/OFF button and target power value, that would be really good.

fizcris commented 2 years ago

Hi,

I have started to do the integration here aquí.

But since then I have found MQTT discovery, whit this there is no need anymore for a has integration as if MQTT discovery is included in the ESP32 all the sensors would be automatically available in hassio as long as they are using the same broker.

pablozg commented 2 years ago

I'm also using HA and indeed, it would be great to have some integration. For example, if just two things were possible to integrate in HA as ON/OFF button and target power value, that would be really good.

Hi, I suggest you to suscribe to the Telegram Channel and ask for the HA integration, I think someone it has done.

You can use a 'POST' message to freeDS to switch ON/OFF with http://FREEDSIP/tooglebuttons?data=6 And switch it between AUTO / MAN with http://FREEDSIP/tooglebuttons?data=7

Or use mqtt as fizcris said, in the future we can integrate MQTT discovery topics.

jorgestima commented 2 years ago

I know that MQTT is a possibility and very powerfull but more complicated to configure. As only recently I've entered in HA world, it is not easy for me to configure that. So, if a simple tool in HACS would be available, for me it would be great.

fizcris commented 2 years ago

I know that MQTT is a possibility and very powerfull but more complicated to configure. As only recently I've entered in HA world, it is not easy for me to configure that. So, if a simple tool in HACS would be available, for me it would be great. Hi,

I think even a native home assistant integration is developed (wich I don't see the need with MQTT discovery) it would be based on MQTT as it is the simplest way to relay infomation/control the freeds from hassio.

I highly recommend you to install the Mosquitto Broker add-on from the supervisor window.

Here below are some examples of how to add freeds sensors in the .yaml configuration file that I have used some time ago... You can use these examples to integrate the relevant parameter you need from freeds while a more suitable solution is developed.

  sensor:
  - platform: mqtt
    name: solar_power
    state_topic: "freeds_d7dc/wsolar"
    unit_of_measurement: "W"
    device_class: power

  - platform: mqtt
    name: grid_power
    state_topic: "freeds_d7dc/wgrid"
    unit_of_measurement: "W"
    device_class: power

  - platform: filter
    name: "Filtered grid power"
    entity_id: sensor.grid_power
    filters:
      - filter: outlier
        window_size: 4
        radius: 4.0
      - filter: lowpass
        time_constant: 4
        precision: 2

  - platform: filter
    name: "Net Power last 60s"
    entity_id: sensor.grid_power
    filters:
      - filter: time_simple_moving_average
        window_size: "00:00:60"
        precision: 2

  - platform: mqtt
    name: load_power
    state_topic: "freeds_d7dc/loadWatts"
    unit_of_measurement: "W"
    device_class: power

  - platform: integration
    source: sensor.solar_power
    name: solar_energy
    method: left
    unit_prefix: k
    round: 2

  - platform: integration
    source: sensor.grid_power_abs
    name: grid_energy
    method: left
    unit_prefix: k
    round: 2

  # - platform: integration
  #   source: sensor.grid_power
  #   name: net_grid_energy
  #   method: left
  #   unit_prefix: k
  #   round: 2

  - platform: integration
    source: sensor.load_power
    name: load_energy
    method: left
    unit_prefix: k
    round: 2
jorgestima commented 2 years ago

Many thanks @fizcris

I will have a look on that. I already have all that data because I have my Goodwe solar inverter communicating using GoodWe Inverter Solar Sensor UDP installed by HACS.

What I was really looking for was to turn ON/OFF the excess power compensation and adjust the target power value using HA. Therefore, I could program and interact with all my other devices in just one single monitoring/control platform.

Do you have any idea on how this could be made in HA?

fizcris commented 2 years ago

Hi,

That's not possible to do at the moment for any third party app regarding an Goodwe inverter as we are still understanding how to change the registers of the inverter using inverse engineering.

I think it will be available shortly as most of the protocol is understood now but I suggest you to join the discord group of the Goodwe integration to follow/assist with the development of such avanced features.

Regards

On Wed, 29 Sep 2021, 00:49 Jorge Estima, @.***> wrote:

Many thanks @fizcris https://github.com/fizcris

I will have a look on that. I already have all that data because I have my Goodwe solar inverter communicating using GoodWe Inverter Solar Sensor UDP installed by HACS.

What I was really looking for was to turn ON/OFF the excess power compensation and adjust the target power value using HA. Therefore, I could program and interact with all my other devices in just one single monitoring/control platform.

Do you have any idea on how this could be made in HA?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pablozg/freeds/issues/21#issuecomment-929679670, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMAWEZ4NFH76OAJ4PEWZ7TUEJA7LANCNFSM4XTGS6MA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jorgestima commented 2 years ago

Well, I think that I didn't explain correctly. The idea is not to change or interact with inverter. What I was saying is putting HA sending commands to MCU/FreeDS to turn ON/OFF the excess power compensation and adjust the target power value.

So, you already sent the code to read values from MCU using MQTT in HA. What would be the code to send command to turn ON/OFF compensation and change target power value?

IvanSanchez commented 1 year ago

Hi, folks,

I've found out that setting up MQTT is a bit too fiddly, so in the end I've created a HASS integration that relies on the http://$ip/events endpoint - values available at that endpoint are automatically exposed as HASS sensors.

It may be buggy at the moment, and can only handle one FreeDS in the same network (because of #82), but the basics work. It handles websockets (for 1.1-beta16 FreeDS firmware), reconnection, zeroconf, relays. It works well, as far as I can tell.

See https://gitlab.com/IvanSanchez/homeassistant-freeds