mirror of
https://github.com/alexhopeoconnor/SunGather.git
synced 2026-10-24 03:12:33 +10:00
change is_running to power_state
This commit is contained in:
@@ -107,10 +107,10 @@ exports:
|
|||||||
state_class: measurement
|
state_class: measurement
|
||||||
- name: "Power State"
|
- name: "Power State"
|
||||||
sensor_type: binary_sensor
|
sensor_type: binary_sensor
|
||||||
register: start_stop
|
register: power_state
|
||||||
dev_class: running
|
dev_class: running
|
||||||
payload_on: "Start"
|
payload_on: "ON"
|
||||||
payload_off: "Stop"
|
payload_off: "OFF"
|
||||||
|
|
||||||
# Publish Registers to PVOutput
|
# Publish Registers to PVOutput
|
||||||
- name: pvoutput
|
- name: pvoutput
|
||||||
|
|||||||
@@ -90,11 +90,11 @@ def scrape_inverter():
|
|||||||
try:
|
try:
|
||||||
if inverter.get('start_stop'):
|
if inverter.get('start_stop'):
|
||||||
if inverter.get('start_stop', False) == 'Start' and inverter.get('work_state_1', False) == 'Run':
|
if inverter.get('start_stop', False) == 'Start' and inverter.get('work_state_1', False) == 'Run':
|
||||||
inverter["is_running"] = True
|
inverter["power_state"] = "ON"
|
||||||
else:
|
else:
|
||||||
inverter["is_running"] = False
|
inverter["power_state"] = "OFF"
|
||||||
else:
|
else:
|
||||||
inverter["is_running"] = False
|
inverter["power_state"] = "OFF"
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user