1
0
Fork 0

Home Assistant Git Exporter

main
31c0fe9c6dbd74bcdde92e1d2aaa03e1d272f75f 2022-08-24 17:25:05 +10:00
parent 6617df672a
commit c77de82af4
4 changed files with 43 additions and 28 deletions

View File

@ -42,10 +42,7 @@ automation:
trigger: trigger:
- platform: template - platform: template
value_template: | value_template: |
{{ {{ is_state('sensor.everyone_in_bed', 'on') and states('sensor.plex_tumtum_tree') | int(default=0) == 0 }}
is_state('sensor.everyone_in_bed', 'on') and
is_state('sensor.plex_tumtum_tree', '0')
}}
for: for:
minutes: 15 minutes: 15
variables: variables:

View File

@ -119,6 +119,10 @@ automation:
entity_id: sensor.inverter_battery_level entity_id: sensor.inverter_battery_level
below: input_number.inverter_charging_schedule_2_target_soc below: input_number.inverter_charging_schedule_2_target_soc
variables: variables:
# Enable each schedule only if battery level is below target, it is explicitly enabled, and the dates have values.
# NOTE: It would be better to take into consideration if the schedule is active (timewise) but in effect disabling
# it unconditionally when battery level is higher doesn't matter, since we also trigger when it is lower and
# it will become re-enabled again.
enabled_1: | enabled_1: |
{{ is_state('input_boolean.inverter_charging_schedule_enabled', 'on') and {{ is_state('input_boolean.inverter_charging_schedule_enabled', 'on') and
states('input_number.inverter_charging_schedule_target_soc') | float(default = 0) > states('sensor.inverter_battery_level') | float(default = 0) and states('input_number.inverter_charging_schedule_target_soc') | float(default = 0) > states('sensor.inverter_battery_level') | float(default = 0) and
@ -128,8 +132,8 @@ automation:
enabled_2: | enabled_2: |
{{ is_state('input_boolean.inverter_charging_schedule_2_enabled', 'on') and {{ is_state('input_boolean.inverter_charging_schedule_2_enabled', 'on') and
states('input_number.inverter_charging_schedule_2_target_soc') | float(default = 0) > states('sensor.inverter_battery_level') | float(default = 0) and states('input_number.inverter_charging_schedule_2_target_soc') | float(default = 0) > states('sensor.inverter_battery_level') | float(default = 0) and
not is_state('input_datetime.inverter_charging_schedule_start', 'unknown') and not is_state('input_datetime.inverter_charging_schedule_2_start', 'unknown') and
not is_state('input_datetime.inverter_charging_schedule_end', 'unknown') not is_state('input_datetime.inverter_charging_schedule_2_end', 'unknown')
}} }}
action: action:
- service: script.apply_charging_schedule - service: script.apply_charging_schedule
@ -148,8 +152,8 @@ automation:
{% else %} {% else %}
0 0
{% endif %} {% endif %}
start_time_2: "{{ states('input_datetime.inverter_charging_2_schedule_start') | replace('unknown','00:00') }}" start_time_2: "{{ states('input_datetime.inverter_charging_schedule_2_start') | replace('unknown','00:00') }}"
end_time_2: "{{ states('input_datetime.inverter_charging_2_schedule_end') | replace('unknown','00:00') }}" end_time_2: "{{ states('input_datetime.inverter_charging_schedule_2_end') | replace('unknown','00:00') }}"
- id: 7b93d325bfe632a4e890 - id: 7b93d325bfe632a4e890
alias: Inverter - update battery reserve alias: Inverter - update battery reserve

View File

@ -8,7 +8,7 @@
"linkquality": 215 "linkquality": 215
}, },
"0x00158d0008091c32": { "0x00158d0008091c32": {
"contact": true, "contact": false,
"voltage": 2995, "voltage": 2995,
"battery": 41, "battery": 41,
"temperature": 19, "temperature": 19,
@ -22,7 +22,7 @@
"battery": 44, "battery": 44,
"temperature": 17, "temperature": 17,
"linkquality": 255, "linkquality": 255,
"device_temperature": 20, "device_temperature": 19,
"power_outage_count": 7 "power_outage_count": 7
}, },
"0x00158d0007e7725b": { "0x00158d0007e7725b": {
@ -45,15 +45,15 @@
}, },
"0x00158d0007e4c4f2": { "0x00158d0007e4c4f2": {
"contact": true, "contact": true,
"voltage": 2975, "voltage": 2985,
"battery": 36, "battery": 39,
"temperature": 21, "temperature": 21,
"linkquality": 255, "linkquality": 255,
"device_temperature": 24, "device_temperature": 23,
"power_outage_count": 41 "power_outage_count": 41
}, },
"0x5c0272fffee93bae": { "0x5c0272fffee93bae": {
"occupancy": true, "occupancy": false,
"tamper": false, "tamper": false,
"battery_low": false, "battery_low": false,
"linkquality": 255 "linkquality": 255
@ -67,11 +67,11 @@
"linkquality": 191 "linkquality": 191
}, },
"0xa4c138fda4db2c5e": { "0xa4c138fda4db2c5e": {
"occupancy": true, "occupancy": false,
"battery": 100, "battery": 100,
"sensitivity": "high", "sensitivity": "high",
"keep_time": "120", "keep_time": "120",
"illuminance": 850, "illuminance": 586,
"linkquality": 127 "linkquality": 127
}, },
"0x84b4dbfffe850fda": { "0x84b4dbfffe850fda": {

View File

@ -217,18 +217,6 @@ config:
secondary_info: last-changed secondary_info: last-changed
- entity: sensor.electricity_general_forecast - entity: sensor.electricity_general_forecast
type: entities type: entities
- content: "{% set wattage = states.sensor\n | rejectattr('state', 'in', ['unknown',\
\ 'unavailable'])\n | selectattr('attributes.device_class', 'defined')\n\
\ | selectattr('attributes.device_class', 'eq', 'power')\n | selectattr('attributes.unit_of_measurement',\
\ 'defined')\n | selectattr('attributes.unit_of_measurement', 'eq', \"W\"\
)\n | rejectattr('name', 'search', 'Estimate')\n | rejectattr('name',\
\ 'search', 'Inverter')\n | list\n %}\n\n{% set total = wattage|map(attribute='state')|map('float')|list|sum\
\ / 1000.0|round(3) %}\n{% set meter = (states('sensor.inverter_load_power')|float/1000.0\
\ + states('sensor.eagle_200_meter_power_demand')|float) |round(3) %}\n**TOTAL:**\
\ {{ total }} kW\n**METER:** {{ meter }} kW\n**Unaccounted:** {{ (meter -\
\ total) | round(2) }} kW\n\n{% for s in wattage|sort(attribute='state') %}\n\
- {{ s.name}}: {{s.state}} W\n{% endfor %}"
type: markdown
- cards: - cards:
- entity: sensor.eagle_200_meter_power_demand - entity: sensor.eagle_200_meter_power_demand
max: 5 max: 5
@ -336,6 +324,19 @@ config:
type: section type: section
- entity: input_boolean.inverter_charging_schedule_enabled - entity: input_boolean.inverter_charging_schedule_enabled
name: Enable name: Enable
- conditions:
- entity: input_boolean.inverter_charging_schedule_2_enabled
state: 'on'
row:
name: Active
state: "{{ is_state('input_boolean.inverter_charging_schedule_enabled',\
\ 'on') and\n states('input_number.inverter_charging_schedule_target_soc')\
\ | float(default = 0) > states('sensor.inverter_battery_level') | float(default\
\ = 0) and\n not is_state('input_datetime.inverter_charging_schedule_start',\
\ 'unknown') and\n not is_state('input_datetime.inverter_charging_schedule_end',\
\ 'unknown')\n}}\n"
type: custom:template-entity-row
type: conditional
- conditions: - conditions:
- entity: input_boolean.inverter_charging_schedule_enabled - entity: input_boolean.inverter_charging_schedule_enabled
state: 'on' state: 'on'
@ -364,6 +365,19 @@ config:
type: section type: section
- entity: input_boolean.inverter_charging_schedule_2_enabled - entity: input_boolean.inverter_charging_schedule_2_enabled
name: Enable name: Enable
- conditions:
- entity: input_boolean.inverter_charging_schedule_2_enabled
state: 'on'
row:
name: Active
state: "{{ is_state('input_boolean.inverter_charging_schedule_2_enabled',\
\ 'on') and\n states('input_number.inverter_charging_schedule_2_target_soc')\
\ | float(default = 0) > states('sensor.inverter_battery_level') | float(default\
\ = 0) and\n not is_state('input_datetime.inverter_charging_schedule_2_start',\
\ 'unknown') and\n not is_state('input_datetime.inverter_charging_schedule_2_end',\
\ 'unknown')\n}}\n"
type: custom:template-entity-row
type: conditional
- conditions: - conditions:
- entity: input_boolean.inverter_charging_schedule_2_enabled - entity: input_boolean.inverter_charging_schedule_2_enabled
state: 'on' state: 'on'