Fabian-Schmidt / esphome-victron_ble

Use official Victron BLE endpoint for fetching data from Victron devices via Bluetooth LE via ESPHome.
GNU General Public License v3.0
152 stars 15 forks source link

Enhancement Request- #41

Closed dougle03 closed 5 months ago

dougle03 commented 6 months ago

Would be good to add in a template sensor for shunt Watts. (AxV) into your standard full yaml? Perhaps something like this? Note: Requires id's adding to both Amps and Volts sensors.

- platform: template name: "Watts" unit_of_measurement: "W" accuracy_decimals: 1 icon: "mdi:flash" lambda: |- return id(amps).state * id(volts).state;

Fabian-Schmidt commented 5 months ago

There is already the field BATTERY_POWER which combines BATTERY_CURRENT and BATTERY_VOLTAGE.

Is this the Watt value you are referring to?

If not can you please share more of your configuration? As I don't know which fields the id amps and volts are referencing.

dougle03 commented 5 months ago

I'm not seeing that field in my implementation! The items highlighted by the red line are the only sensors I'm getting from my Shunt via the integration. image Am I missing some other fields too?

Fabian-Schmidt commented 5 months ago

If you check the configured sensors in ESP Home you should have a BATTERY_CURRENT and BATTERY_VOLTAGE field. Just add add a BATTERY_POWER. From a technical side it does exactly the same as you do just multiplying the two values.

dougle03 commented 5 months ago

If you check the configured sensors in ESP Home you should have a BATTERY_CURRENT and BATTERY_VOLTAGE field. Just add add a BATTERY_POWER. From a technical side it does exactly the same as you do just multiplying the two values.

Thanks for this. I did use the full.yaml as my template, so not sure how I missed this. Thanks again.