JuiceRescue / juicepassproxy

Proxy UDP requests to/from Juicebox EV chargers to MQTT discoverable by Home Assistant
Apache License 2.0
86 stars 12 forks source link

CMD responses should only be sent to telemetry messages, not DBG, etc. #101

Closed FalconFour closed 1 month ago

FalconFour commented 1 month ago

Simple protocol inconsistency - may be my fault, as I said "every message needs a response". I should clarify: every telemetry message (the ones that say voltage, current, state, etc) expects a CMD ping response :)

I've seen my box repeatedly complain about directory server lookups, to which it replies with a CMD string. Not strictly a bad thing, but could result in an infinite loop if the CMD checksum is bad somehow.

2024-10-06 20:25:00  INFO      [juicebox_message] from_string 0817081001070432386218277503:DBG,ERR:DirSvc acq err:
2024-10-06 20:25:00  ERROR     [juicebox_message] unable to parse value from message 0817081001070432386218277503:DBG,ERR:DirSvc acq err
2024-10-06 20:25:00  DEBUG     [juicebox_mqtthandler] From JuiceBox: b'0817081001070432386218277503:DBG,ERR:DirSvc acq err:'
2024-10-06 20:25:00  DEBUG     [juicebox_mqtthandler] Publish Debug Message: {'type': 'debug', 'debug_message': 'ERROR: DirSvc acq err'}
2024-10-06 20:25:00  INFO      [ha_mqtt_discoverable.sensors] Setting Last Debug Message to ERROR: DirSvc acq err using hmd/sensor/JuiceBox/Last-Debug-Message/state
2024-10-06 20:25:00  INFO      [juicebox_mitm] command message = CMD02025A26M31C006S164!000$ new_values=False new_version=False
2024-10-06 20:25:00  INFO      [juicebox_mitm] Sending command to juicebox CMD02025A26M31C006S164!000$ new_values=False
2024-10-06 20:27:00  WARNING   [juicebox_mitm] No Message Received after 120 sec. (TimeoutError: )

The above is just a DBG,ERR message, no need to send outgoing CMD message :)

ivanfmartinez commented 1 month ago

@FalconFour please check this change https://github.com/JuiceRescue/juicepassproxy/pull/69/commits/d3121f461cdcde04eeefe00177bc3c22b791773b