1
0
Fork 0

Home Assistant Git Exporter

main
31c0fe9c6dbd74bcdde92e1d2aaa03e1d272f75f 2022-08-25 12:25:05 +10:00
parent 797e9578a3
commit d952db1b07
4 changed files with 116 additions and 105 deletions

View File

@ -39,17 +39,18 @@ switch:
automation:
- id: 964db306d8b009f8f640
alias: Power NAS/Tumtum according to sleep
mode: restart # so we only do latest
trigger:
- platform: template
value_template: |
{{ is_state('sensor.everyone_in_bed', 'on') and states('sensor.plex_tumtum_tree') | int(default=0) == 0 }}
{{ is_state('group.everyone_in_bed', 'on') and states('sensor.plex_tumtum_tree') | int(default=0) == 0 }}
for:
minutes: 15
variables:
service: switch.turn_off
- platform: template
value_template: |
{{ is_state('sensor.everyone_in_bed', 'off') }}
{{ is_state('group.everyone_in_bed', 'off') }}
for:
minutes: 15
variables:

View File

@ -549,7 +549,7 @@ modbus:
device_class: power
state_class: measurement
scale: 1
scan_interval: 10
scan_interval: 1
- name: Inverter active power
unique_id: a3ee41f78c6c55377c00
@ -564,7 +564,7 @@ modbus:
device_class: power
state_class: measurement
scale: 1
scan_interval: 10
scan_interval: 1
- name: Inverter reactive power
unique_id: 5a58fe975877eec6d37c
@ -611,27 +611,28 @@ modbus:
# scale: 100
# scan_interval: 10
# - name: System state
# slave: 1
# address: 12999
# input_type: input
# count: 1
# data_type: uint16
# swap: word
# precision: 0
# scale: 1
# scan_interval: 10
- name: Inverter system state (raw)
slave: 1
address: 12999
input_type: input
count: 1
data_type: uint16
swap: word
precision: 0
scale: 1
scan_interval: 1
# - name: Running state
# slave: 1
# address: 13000
# input_type: input
# count: 1
# data_type: uint16
# swap: word
# precision: 0
# scale: 1
# scan_interval: 10
# Currently this only ever returns 0x00 over Modbus :/
- name: Inverter running state (raw)
slave: 1
address: 13000
input_type: input
count: 1
data_type: uint16
swap: word
precision: 0
scale: 1
scan_interval: 1
- name: Inverter PV generation today
unique_id: 27953d57c315260a7983
@ -706,7 +707,7 @@ modbus:
device_class: power
state_class: measurement
scale: 1
scan_interval: 10
scan_interval: 1
- name: Inverter export power
unique_id: 4c3bac29a87561796c06
@ -721,7 +722,7 @@ modbus:
device_class: power
state_class: measurement
scale: 1
scan_interval: 10
scan_interval: 1
- name: Inverter battery charge from PV today
unique_id: d496459e40e0d49f5c11
@ -814,7 +815,7 @@ modbus:
device_class: current
state_class: measurement
scale: 0.1
scan_interval: 10
scan_interval: 1
- name: Inverter battery power (raw)
unique_id: 4f7dacbf06d004b547d9
@ -829,7 +830,7 @@ modbus:
device_class: power
state_class: measurement
scale: 1
scan_interval: 10
scan_interval: 1
- name: Inverter battery level
unique_id: 61e9d0508f0e75a3f25c
@ -902,6 +903,7 @@ modbus:
scale: 0.1
scan_interval: 10
# NOTE: this is broken over modbus and only ever returns 0x00
# - name: Grid state raw
# slave: 1
# address: 13029
@ -1031,52 +1033,52 @@ modbus:
# precision: 0
# scan_interval: 60
# - name: Battery Charge Discharge Power
# slave: 1
# address: 13051 # 13052
# input_type: holding
# count: 1
# data_type: uint16
# swap: word
# precision: 0
# # datasheet says:
# # 0 to 5000 W for SH*K-*
# # 0 to 100 % for SH*.0RT
# # for my SH10RT it is set in W...
# unit_of_measurement: W
# device_class: power
# state_class: measurement
# scan_interval: 10
- name: Inverter battery forced charge/discharge power
slave: 1
address: 13051 # 13052
input_type: holding
count: 1
data_type: uint16
swap: word
precision: 0
# datasheet says:
# 0 to 5000 W for SH*K-*
# 0 to 100 % for SH*.0RT
# for my SH10RT it is set in W...
unit_of_measurement: W
device_class: power
state_class: measurement
scan_interval: 10
# - name: Inverter max SoC
# unique_id: c602a1446bddc9d6fa7a
# slave: 1
# address: 13057 # 13058
# input_type: holding
# count: 1
# data_type: uint16
# swap: word
# precision: 1
# unit_of_measurement: "%"
# device_class: battery
# state_class: measurement
# scale: 0.1
# scan_interval: 60
- name: Inverter max SoC
unique_id: c602a1446bddc9d6fa7a
slave: 1
address: 13057 # 13058
input_type: holding
count: 1
data_type: uint16
swap: word
precision: 1
unit_of_measurement: "%"
device_class: battery
state_class: measurement
scale: 0.1
scan_interval: 60
# - name: Inverter min SoC
# unique_id: 61a08ee663d37248f372
# slave: 1
# address: 13058 # 13059
# input_type: holding
# count: 1
# data_type: uint16
# swap: word
# precision: 1
# unit_of_measurement: "%"
# device_class: battery
# state_class: measurement
# scale: 0.1
# scan_interval: 60
- name: Inverter min SoC
unique_id: 61a08ee663d37248f372
slave: 1
address: 13058 # 13059
input_type: holding
count: 1
data_type: uint16
swap: word
precision: 1
unit_of_measurement: "%"
device_class: battery
state_class: measurement
scale: 0.1
scan_interval: 60
# binary_sensor:
# - platform: template
@ -1109,6 +1111,8 @@ sensor:
{% set power = states('sensor.inverter_battery_power_raw') %}
{% if 'unavailable' in [current, power] %}
unavailable
{% elif 'unknown' in [current, power] %}
unknown
{% elif current|float < 0.0 and power|float > 0.0 %}
{{ -1 * power | float }}
{% else %}
@ -1116,35 +1120,37 @@ sensor:
{% endif %}
unit_of_measurement: W
device_class: power
# sungrow_inverter_state:
# # Inverter States from modbus reference manual
# friendly_name: "Sungrow Inverter State"
# value_template: >-
# {% if ((states('sensor.system_state') | int(default=0)) == 0x0002) %}
# Stop
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0008) %}
# Standby
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0010) %}
# Initial Standby
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0020) %}
# Startup
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0040) %}
# Running
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0100) %}
# Fault
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0400) %}
# Maintain mode
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x0800) %}
# Forced mode
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x1000) %}
# Off-grid mode
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x2501) %}
# Restarting
# {% elif ((states('sensor.system_state') | int(default=0)) == 0x4000) %}
# External EMS mode
# {% else %}
# Unknown - should not see me!
# {% endif %}
inverter_state:
# Inverter States from modbus reference manual
friendly_name: "Inverter state"
value_template: >-
{% if ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0002) %}
Stop
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0008) %}
Standby
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0010) %}
Initial Standby
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0020) %}
Startup
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0040) %}
Running
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0100) %}
Fault
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0400) %}
Maintain mode
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x0800) %}
Forced mode
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x8200) %}
Dispatch running {# what even is this? #}
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x1000) %}
Off-grid mode
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x2501) %}
Restarting
{% elif ((states('sensor.inverter_system_state_raw') | int(default=0)) == 0x4000) %}
External EMS mode
{% else %}
unknown {#- should not see this #}
{% endif %}
# sungrow_grid_state:
# friendly_name: "Sungrow Grid State"

View File

@ -13,7 +13,7 @@
"battery": 41,
"temperature": 19,
"linkquality": 255,
"device_temperature": 21,
"device_temperature": 23,
"power_outage_count": 8
},
"0x00158d00080915bd": {
@ -53,7 +53,7 @@
"power_outage_count": 41
},
"0x5c0272fffee93bae": {
"occupancy": true,
"occupancy": false,
"tamper": false,
"battery_low": false,
"linkquality": 255
@ -68,10 +68,10 @@
},
"0xa4c138fda4db2c5e": {
"occupancy": true,
"battery": 50,
"battery": 100,
"sensitivity": "high",
"keep_time": "120",
"illuminance": 874,
"illuminance": 898,
"linkquality": 127
},
"0x84b4dbfffe850fda": {

View File

@ -95,6 +95,10 @@ config:
type: entities
title: Battery
type: custom:stack-in-card
- entities:
- entity: sensor.inverter_state
- entity: sensor.inverter_system_state_raw
type: entities
icon: mdi:solar-power-variant
theme: Backend-selected
title: Solar