Hallo,
bei mir funktioniert leider die Powerfox Anbindung in HA nicht mehr seit dem Firmware Update des Powerfox. Wer hat eine Idee?
bei mir funktioniert leider die Powerfox Anbindung in HA nicht mehr seit dem Firmware Update des Powerfox. Wer hat eine Idee?
Code:
# powerfox.de
rest:
- resource: http://192.168.2.128/rpc
method: POST
payload: '{"id":1,"jsonrpc":"2.0","method":"getConfig","params":{"key":"latest_data"}}'
scan_interval: 1
headers:
Content-Type: application/json
sensor:
- name: "poweropti_local"
json_attributes:
- "jsonrpc"
- "id"
- "result"
value_template: >
{% set json = value_json.result | base64_decode %}
{% set Timestmp = (json | from_json())[0].t %}
{% set zaehlernummer = (json | from_json())[0].m %}
{% set A_Plus = (json | from_json())[0].d[0].v %}
{% set A_Plus_HT = (json | from_json())[0].d[1].v %}
{% set A_Plus_NT = (json | from_json())[0].d[2].v %}
{% set A_Minus = (json | from_json())[0].d[3].v %}
{% set timestmp2 = (json | from_json())[1].t %}
{% set watt = (json | from_json())[1].d[0].v %}
{{ '{"Watt":' + (watt | string) + ',"Timestamp":' + (Timestmp | string) + ',"A_Plus":' + (((A_Plus | float) / 1000) | string) + ',"A_Minus":' + (((A_Minus | float) / 1000) | string) + '}' }}