Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate this directly into JPP? #44

Open
Snuffy2 opened this issue Jun 5, 2024 · 3 comments
Open

Incorporate this directly into JPP? #44

Snuffy2 opened this issue Jun 5, 2024 · 3 comments

Comments

@Snuffy2
Copy link

Snuffy2 commented Jun 5, 2024

@wozz any interest in incorporating the ability to run JuicePass Proxy (JPP) as a HA Addon directly into JPP? I've not built an HA AddOn before but looking at your wrapper, it seems like we could add it into the JPP code without the need for a wrapper? If interested, I'm happy to work with you to do it.

@wozz
Copy link
Owner

wozz commented Jun 5, 2024

sure - I just started here in my repo since it's easier to iterate - I can port it over to your repo pretty easily

@troydangerfield
Copy link

troydangerfield commented Jun 9, 2024

Happy to test if you need one. I have installed the wrapper but I am unable to find where the code is installed as I would like to make changes to the config files.

My log is:

2024-06-09 11:14:36 WARNING [main] Starting JuicePass Proxy v0.2.2 (Log Level: DEBUG)
2024-06-09 11:14:36 INFO [main] log_loc: /log/juicepassproxy.log
2024-06-09 11:14:36 INFO [main] config_loc: /config/juicepassproxy.yaml
2024-06-09 11:14:36 INFO [main] telnet timeout: 30
2024-06-09 11:14:36 INFO [main] ignore_enelx: False
2024-06-09 11:14:36 INFO [telnetlib3.client] Connected to <Peer 192.168.20.12 2000>
2024-06-09 11:14:38 DEBUG [main] enelx_server_port: emwjuicebox.cloudapp.net:8042
2024-06-09 11:14:38 INFO [main] enelx_server: emwjuicebox.cloudapp.net
2024-06-09 11:14:38 INFO [main] enelx_port: 8042
2024-06-09 11:14:38 INFO [telnetlib3.client] Connection closed to <Peer 192.168.20.12 2000>
2024-06-09 11:14:38 INFO [main] local_addr: 172.30.33.5:8042
2024-06-09 11:14:38 INFO [main] enelx_addr: 40.118.171.20:8042
2024-06-09 11:14:38 INFO [telnetlib3.client] Connected to <Peer 192.168.20.12 2000>
2024-06-09 11:14:40 ERROR [main] Cannot get JuiceBox ID from Telnet and not in Config. If a JuiceBox ID is later set or is obtained via Telnet, it will likely create a new JuiceBox Device with new Entities in Home Assistant.
2024-06-09 11:14:40 INFO [main] experimental: False
2024-06-09 11:14:40 INFO [telnetlib3.client] Connection closed to <Peer 192.168.20.12 2000>
2024-06-09 11:14:40 INFO [juicebox_mqtthandler] Starting JuiceboxMQTTHandler
2024-06-09 11:14:40 INFO [juicebox_mitm] Starting JuiceboxMITM
2024-06-09 11:14:40 DEBUG [juicebox_mitm] JPP: 172.30.33.5:8042
2024-06-09 11:14:40 DEBUG [juicebox_mitm] EnelX: 40.118.171.20:8042
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Status/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Status/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Current/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Current/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Current-Rating/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Current-Rating/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Frequency/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Frequency/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Energy--Lifetime-/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Energy--Lifetime-/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Energy--Session-/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Energy--Session-/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Temperature/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Temperature/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Voltage/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Voltage/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Power/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Power/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] config_topic: homeassistant/sensor/JuiceBox/Last-Debug-Message/config
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable] state_topic: hmd/sensor/JuiceBox/Last-Debug-Message/state
2024-06-09 11:14:40 INFO [ha_mqtt_discoverable.sensors] Setting Last Debug Message to INFO: Starting JuicePass Proxy v0.2.2 using hmd/sensor/JuiceBox/Last-Debug-Message/state
2024-06-09 11:14:45 DEBUG [juicebox_mitm] Starting JuiceboxMITM Loop

But no MQTT data is being posted.

I have no access to the X JP app as my charger is too old to connect now as they have turned off the server. I am a bit lost as to what I need to do to get this to work.

@wozz
Copy link
Owner

wozz commented Jun 10, 2024

The config will be via a tab in the add-on page, however not all the configs are exposed. For example, the mqtt configs are setup automatically, assuming that the mqtt service is supplied by a separate add-on. HA gives add-ons temporary credentials to access the mqtt service this way. The fact that there are no errors in the log related to mqtt implies that it did successfully connect to mqtt.

If there are more config values that need to be exposed, you can check these files:

https://github.com/wozz/ha-addons/blob/main/juicepassproxy/config.yaml#L17
https://github.com/wozz/ha-addons/blob/main/juicepassproxy/run.sh#L3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants