26 lines
770 B
Python
26 lines
770 B
Python
|
|
#mqtt topics
|
|
topic_discovery_base = "homeassistant/"
|
|
topic_discovery = "/config"
|
|
topic_discovery_battery_component = "sensor"
|
|
topic_base = "avr95/battery/"
|
|
topic_command_postfix = "/set"
|
|
topic_state_postfix = "/state"
|
|
|
|
topic_p1_consumption = 'sensors/power/p1meter/actual_consumption'
|
|
topic_p1_return = 'sensors/power/p1meter/actual_returndelivery'
|
|
|
|
|
|
|
|
topic_chargemode = topic_base + "chargemode" + topic_command_postfix
|
|
topic_power = topic_base + "chargevalue" + topic_command_postfix
|
|
|
|
topic_bat_consumption = topic_base + 'actual_consumption'
|
|
|
|
#battery packs
|
|
topic_batpack_soc = topic_base + '{}_soc' + topic_state_postfix
|
|
|
|
import os
|
|
broker=os.environ.get("CHARGEMAN_MQTT_BROKER", "10.2.0.15")
|
|
port=int(os.environ.get("CHARGEMAN_MQTT_PORT", "1883"))
|