diff --git a/templates/definition/meter/sessy-p1.yaml b/templates/definition/meter/sessy-p1.yaml new file mode 100644 index 000000000..8fc06991b --- /dev/null +++ b/templates/definition/meter/sessy-p1.yaml @@ -0,0 +1,106 @@ +template: sessy-p1 +products: + - brand: Sessy + description: + generic: Sessy P1 +params: + - name: usage + choice: ["grid"] + - name: host + - name: cache + default: 10 +render: | + type: custom + power: + source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .power_total + cache: {{ .cache }} + timeout: 10s + energy: + source: calc + add: + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .power_consumed_tariff1 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .power_consumed_tariff2 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .power_produced_tariff1 + scale: -0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .power_produced_tariff2 + scale: -0.001 + cache: {{ .cache }} + timeout: 10s + currents: + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .current_l1 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .current_l2 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .current_l3 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + voltages: + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .voltage_l1 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .voltage_l2 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v2/p1/details + headers: + - content-type: application/json + jq: .voltage_l3 + scale: 0.001 + cache: {{ .cache }} + timeout: 10s diff --git a/templates/definition/meter/sessy-smart-battery.yaml b/templates/definition/meter/sessy-smart-battery.yaml new file mode 100644 index 000000000..53c6819a4 --- /dev/null +++ b/templates/definition/meter/sessy-smart-battery.yaml @@ -0,0 +1,160 @@ +template: sessy-smart-battery +covers: [sessy-smart-battery] +products: + - brand: Sessy + description: + generic: Sessy Smart Battery +capabilities: ["battery-control"] +params: + - name: usage + choice: ["battery"] + - name: host + - name: user + required: true + - name: password + required: true + - name: cache + default: 10 + - preset: battery-params + - name: capacity + default: 5 +render: | + type: custom + power: + source: http + uri: http://{{ .host }}/api/v1/power/status + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + jq: .sessy.power + cache: {{ .cache }} + timeout: 10s + energy: + source: http + uri: http://{{ .host }}/api/v1/energy/status + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + jq: .sessy_energy.import_wh + cache: {{ .cache }} + timeout: 10s + soc: + source: http + uri: http://{{ .host }}/api/v1/power/status + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + jq: .sessy.state_of_charge + scale: 100 + cache: {{ .cache }} + timeout: 10s + voltages: + - source: http + uri: http://{{ .host }}/api/v1/power/status + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + jq: .renewable_energy_phase1.voltage_rms + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v1/power/status + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + jq: .renewable_energy_phase2.voltage_rms + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + - source: http + uri: http://{{ .host }}/api/v1/power/status + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + jq: .renewable_energy_phase3.voltage_rms + scale: 0.001 + cache: {{ .cache }} + timeout: 10s + batterymode: + source: switch + switch: + - case: 1 # normal + set: + source: http + uri: http://{{ .host }}/api/v1/power/active_strategy + method: POST + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + body: '{"strategy": "POWER_STRATEGY_NOM"}' + - case: 2 # hold + set: + source: sequence + set: + - source: http + uri: http://{{ .host }}/api/v1/power/active_strategy + method: POST + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + body: '{"strategy": "POWER_STRATEGY_API"}' + - source: http + uri: http://{{ .host }}/api/v1/power/setpoint + method: POST + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + body: '{"setpoint": 0}' + - case: 3 # charge + set: + source: sequence + set: + - source: http + uri: http://{{ .host }}/api/v1/power/active_strategy + method: POST + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + body: '{"strategy": "POWER_STRATEGY_API"}' + - source: http + uri: http://{{ .host }}/api/v1/power/setpoint + method: POST + auth: + type: basic + user: {{ .user }} + password: {{ .password }} + headers: + - content-type: application/json + body: '{"setpoint": -2200}' + capacity: {{ .capacity }}