services: Fix power total_kwh
This commit is contained in:
parent
381a0e2c2e
commit
fa31ab8590
2 changed files with 3 additions and 2 deletions
|
@ -15,7 +15,8 @@ export:
|
|||
- subscribe: bitlair/#
|
||||
- subscribe: bitlair/climate/+location/#
|
||||
- subscribe: bitlair/climate/+location/dust_mass/+size
|
||||
- subscribe: bitlair/power/+net/+group/#
|
||||
- subscribe: bitlair/power/+net/+group/now_w
|
||||
- subscribe: bitlair/power/+net/total_kwh
|
||||
- subscribe: bitlair/wifi/+ssid/#
|
||||
|
||||
- subscribe: bitlair/state
|
||||
|
|
|
@ -21,7 +21,7 @@ while True:
|
|||
sleep(10)
|
||||
try:
|
||||
data = requests.get(f'http://{sdm630_host}/api/v1/data').json()
|
||||
client.publish('bitlair/power/total_kwh', data['total_power_import_kwh'])
|
||||
client.publish(f'bitlair/power/{net}/total_kwh', data['total_power_import_kwh'])
|
||||
client.publish(f'bitlair/power/{net}/All/now_w', data['active_power_w'])
|
||||
client.publish(f'bitlair/power/{net}/L1/now_w', data['active_power_l1_w'])
|
||||
client.publish(f'bitlair/power/{net}/L2/now_w', data['active_power_l2_w'])
|
||||
|
|
Loading…
Add table
Reference in a new issue