mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-14 00:21:44 +02:00
Change default mqtt prefix to hoymiles/serial
This commit is contained in:
parent
a33c49fd35
commit
a1cfaf5918
2 changed files with 8 additions and 5 deletions
|
@ -96,11 +96,14 @@ def poll_inverter(inverter):
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if mqtt_client:
|
if mqtt_client:
|
||||||
mqtt_send_status(mqtt_client, inverter_ser, data)
|
mqtt_send_status(mqtt_client, inverter_ser, data,
|
||||||
|
topic=inverter.get('mqtt', {}).get('topic', None)
|
||||||
|
|
||||||
|
def mqtt_send_status(broker, interter_ser, data, topic=None):
|
||||||
|
""" Publish StatusResponse object """
|
||||||
|
|
||||||
def mqtt_send_status(broker, interter_ser, data):
|
if not topic:
|
||||||
topic = f'ahoy/{inverter_ser}'
|
topic = f'hoymiles/{inverter_ser}'
|
||||||
|
|
||||||
# AC Data
|
# AC Data
|
||||||
phase_id = 0
|
phase_id = 0
|
||||||
|
@ -125,7 +128,7 @@ def mqtt_send_status(broker, interter_ser, data):
|
||||||
def mqtt_on_command():
|
def mqtt_on_command():
|
||||||
"""
|
"""
|
||||||
Handle commands to topic
|
Handle commands to topic
|
||||||
ahoy/{inverter_ser}/command
|
hoymiles/{inverter_ser}/command
|
||||||
frame it and put onto command_queue
|
frame it and put onto command_queue
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError('Receiving mqtt commands is yet to be implemented')
|
raise NotImplementedError('Receiving mqtt commands is yet to be implemented')
|
||||||
|
|
|
@ -17,4 +17,4 @@ ahoy:
|
||||||
- name: 'balkon'
|
- name: 'balkon'
|
||||||
serial: 114172220003
|
serial: 114172220003
|
||||||
mqtt:
|
mqtt:
|
||||||
topic: 'ahoy/114172220143' # defaults to 'ahoy/{serial}'
|
topic: 'hoymiles/114172221234' # defaults to 'hoymiles/{serial}'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue