Skip to content

Instantly share code, notes, and snippets.

@Bre77
Created April 14, 2021 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bre77/518b96a6e18cf82dd1b9df41e5fc80fe to your computer and use it in GitHub Desktop.
Save Bre77/518b96a6e18cf82dd1b9df41e5fc80fe to your computer and use it in GitHub Desktop.
Fronius Inverter Data Push to Home Assistant template trigger sensor
template:
- trigger:
- platform: webhook
webhook_id: froniusmeter
unique_id: fronius_
sensor:
- name: Fronius Import Total
unique_id: import
state: '{{(((trigger.data|string)[17:-7])|from_json).Body["0"].EnergyReal_WAC_Sum_Consumed|default(0)|int}}'
icon: mdi:counter
device_class: power
unit_of_measurement: Wh
- name: Fronius Export Total
unique_id: export
state: '{{(((trigger.data|string)[17:-7])|from_json).Body["0"].EnergyReal_WAC_Sum_Produced|default(0)|int}}'
icon: mdi:counter
device_class: power
unit_of_measurement: Wh
- trigger:
- platform: webhook
webhook_id: froniuspowerflow
unique_id: fronius_
sensor:
- name: Fronius Grid
unique_id: grid
state: "{{(((trigger.data|string)[17:-7])|from_json).Body.Site.P_Grid|default(0)|int}}"
icon: mdi:transmission-tower
device_class: power
unit_of_measurement: w
- name: Fronius Solar
unique_id: pv
state: "{{(((trigger.data|string)[17:-7])|from_json).Body.Site.P_PV|default(0)|int}}"
icon: mdi:solar-panel
device_class: power
unit_of_measurement: w
- name: Fronius Load
unique_id: load
state: "{{(((trigger.data|string)[17:-7])|from_json).Body.Site.P_Load|default(0)|int * -1}}"
icon: mdi:power-plug
device_class: power
unit_of_measurement: W
- name: Fronius Solar Total
unique_id: solar
state: "{{(((trigger.data|string)[17:-7])|from_json).Body.Site.E_Total|default(0)|int}}"
icon: mdi:counter
device_class: power
unit_of_measurement: Wh
@Indianagrenoble
Copy link

Dear @Bre77
I used your YAML code for having Fronius Primo Sensors updated in my HA OS...

image

So since 1 month ago I have an Alert about Webhook plateform...
image

image

Do you know If you have another solution for Fronius's Sensor !?

https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger
Best Regards
Alexandre

@Bre77
Copy link
Author

Bre77 commented Jul 3, 2023

You can use the built in Fronius integration instead. I can't read the error you posted as it's not in English.

@Indianagrenoble
Copy link

Update webhook trigger: froniusmeter
This will no longer work in version 2023.7.0. Please fix this before upgrading.
A choice needs to be made as to whether the froniusmeter webhook automation trigger is accessible from the Internet. Modify the "Trigger Update Coordinator" automation, (``) and click on the gear icon next to the Webhook ID to choose a value for 'Only accessible from local network'.

Warning - 02/07/2023

Translated with www.DeepL.com/Translator (free version)

@Indianagrenoble
Copy link

I cut all your code and in fact, you are right, my Fronius installation is mapped by Fronius integration...

Sorry to disturb you about this small problem...

Best regards

@MaartenMol
Copy link

I have added your template to HASS. But I can't seem to find it anywhere. What would the URL be to send data to this webhook?

@MaartenMol
Copy link

I have added your template to HASS. But I can't seem to find it anywhere. What would the URL be to send data to this webhook?

Scratch that, I have found it but I am only receiving error that there is no data in the dict. I have tried to change your formatting but no luck.

@Bre77
Copy link
Author

Bre77 commented Aug 1, 2023

I have added your template to HASS. But I can't seem to find it anywhere. What would the URL be to send data to this webhook?

Scratch that, I have found it but I am only receiving error that there is no data in the dict. I have tried to change your formatting but no luck.

If your having trouble, I would recommend using the built in Fronius integration instead. Its much better now, and I dont even use this push method anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment