ich habe die Rest-API in den Home-Assistant integriert - ich hoffe es spart jemandem Zeit.
Alle settings sind in der "configuration.yaml" zu erledigen. Anschließend können die Werte über das Dashboard oder Automatisierungen verwendet werden.
Viele Grüße
Andreas
Code: Alles auswählen
sensor:
# smartWB
- platform: rest
name: smartWB
authentication: basic
scan_interval: 10
resource: http://<smartwb>/getParameters
json_attributes_path: "$.list.[0]"
value_template: '{{ value_json.smartwb }}'
json_attributes:
- "vehicleState"
- "evseState"
- "actualCurrent"
- "actualPower"
- "duration"
- platform: template
sensors:
smartwb_actualcurrent:
friendly_name: 'Actual Current'
unit_of_measurement: "A"
device_class: 'current'
value_template: '{{ states.sensor.smartwb.attributes["actualCurrent"] }}'
smartwb_actualpower:
friendly_name: 'Actual Power'
unit_of_measurement: "kW"
value_template: '{{ states.sensor.smartwb.attributes["actualPower"] }}'
smartwb_duration:
friendly_name: 'Duration'
unit_of_measurement: "Minutes"
value_template: '{{ ((states.sensor.smartwb.attributes["duration"] | int / 60000 | round(1) )) }}'
smartwb_vehiclestate:
friendly_name: 'Vehicle State'
value_template: >-
{% set mapper = ['Unknown', 'Ready', 'Detected', 'Charging'] %}
{{ mapper[states.sensor.smartwb.attributes["vehicleState"] | int] }}
Code: Alles auswählen
binary_sensor:
- platform: template
sensors:
smartwb_evsestate:
friendly_name: 'EVSE State'
value_template: '{{ states.sensor.smartwb.attributes["evseState"] }}'
Code: Alles auswählen
rest_command:
smartwb_activate:
url: 'http://<smartwb>/setStatus?active=true'
method: GET
smartwb_deactivate:
url: 'http://<smartwb>/setStatus?active=false'
method: GET
smartwb_setcurrent:
url: "http://<smartwb>/setCurrent?current={{ states('input_number.smartwbcurrent') }}"
method: GET