mb-software / homeassistant-powerbrain

Custom Component for Homeassistant to integrate cFos Powerbrain devices
MIT License
14 stars 1 forks source link

cFos Powerbrain: Set Energy Meter #85

Open siggi587969 opened 5 months ago

siggi587969 commented 5 months ago

Hello,

I wanted to use an http input sensor for solar charging. I saw there is already a service for this “cFos Powerbrain: Set Energy Meter”. What do I have to write in the service data? I only want to transmit current consumption. Thank you Matthias

empi89 commented 2 months ago

What has worked for me is: "Einstellungen" -> "Automatisierung & Szenen" -> "Automatisierung erstellen" -> "Neue Automatisierung erstellen" -> top right menu "Als yaml bearbeiten", then paste:

alias: smart meter to wallbox
description: ""
trigger:
  - platform: time_pattern
    seconds: /10
action:
  - service: powerbrain.set_meter
    metadata: {}
    data:
      dev_id: M4
      power: "{{ int(states('sensor.smart_meter_sum_active_instantaneous_power')) }}"
      import_energy: >-
        {{ int(states('sensor.smart_meter_positive_active_energy_total'))/1000
        }}
      export_energy: >-
        {{ int(states('sensor.smart_meter_negative_active_energy_total'))/1000
        }}
      voltage_l1: 230
      voltage_l2: 230
      voltage_l3: 230
      current_l1: >-
        {{int(
        int(states('sensor.smart_meter_sum_active_instantaneous_power'))/0.69)/1000
        }}
      current_l2: >-
        {{
        int(int(states('sensor.smart_meter_sum_active_instantaneous_power'))/0.69)/1000
        }}
      current_l3: >-
        {{
        int(int(states('sensor.smart_meter_sum_active_instantaneous_power'))/0.69)/1000
        }}
      powerbrain_host: http://192.168.178.XXX
      is_va: false

Whereas sensor.smart_meter_sum_active_instantaneous_power is power in Watt and energy_total is Wh. Please replace powerbrain_host with ip address within your network and "M4" with the corresponding energy meter you have created as "http input" with role "Netzbezug" in cfos powerbrain.