Nevermind. I’ve changed clientId and password in the sydpower.run.js and it works.
So is that:
// MQTT configuration
const mqttHost = "ws://mqtt.sydpower.com:8083/mqtt";
const clientId = "XXX_FOSSIBOT_EMAIL";
const password = "XXX_FOSSIBOT_PASS";
Or was that something else ? Cus I’ve just modified my docker image CMD to change those 2 to values to the input docker variables USERNAME
& PASSWORD
and it still gives me errors:
2025-03-09 22:03:39 Error: connack timeout
2025-03-09 22:03:39 at Timeout._onTimeout (/app/node_modules/mqtt/build/lib/client.js:316:32)
2025-03-09 22:03:39 at listOnTimeout (node:internal/timers:594:17)
2025-03-09 22:03:39 at process.processTimers (node:internal/timers:529:7)
2025-03-09 22:03:41 ErrorWithReasonCode: Connection refused: Not authorized
2025-03-09 22:03:41 at handleConnack (/app/node_modules/mqtt/build/lib/handlers/connack.js:42:21)
2025-03-09 22:03:41 at handle (/app/node_modules/mqtt/build/lib/handlers/index.js:44:35)
2025-03-09 22:03:41 at work (/app/node_modules/mqtt/build/lib/client.js:227:40)
2025-03-09 22:03:41 at writable._write (/app/node_modules/mqtt/build/lib/client.js:252:13)
2025-03-09 22:03:41 at writeOrBuffer (/app/node_modules/readable-stream/lib/internal/streams/writable.js:334:12)
2025-03-09 22:03:41 at _write (/app/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
2025-03-09 22:03:41 at Writable.write (/app/node_modules/readable-stream/lib/internal/streams/writable.js:286:10)
2025-03-09 22:03:41 at Duplex.ondata (node:internal/streams/readable:1009:22)
2025-03-09 22:03:41 at Duplex.emit (node:events:518:28)
2025-03-09 22:03:41 at addChunk (node:internal/streams/readable:561:12) {
2025-03-09 22:03:41 code: 5
2025-03-09 22:03:41 }
2025-03-09 22:03:43 ErrorWithReasonCode: Connection refused: Not authorized
2025-03-09 22:03:43 at handleConnack (/app/node_modules/mqtt/build/lib/handlers/connack.js:42:21)
2025-03-09 22:03:43 at handle (/app/node_modules/mqtt/build/lib/handlers/index.js:44:35)
2025-03-09 22:03:43 at work (/app/node_modules/mqtt/build/lib/client.js:227:40)
2025-03-09 22:03:43 at writable._write (/app/node_modules/mqtt/build/lib/client.js:252:13)
2025-03-09 22:03:43 at writeOrBuffer (/app/node_modules/readable-stream/lib/internal/streams/writable.js:334:12)
2025-03-09 22:03:43 at _write (/app/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
2025-03-09 22:03:43 at Writable.write (/app/node_modules/readable-stream/lib/internal/streams/writable.js:286:10)
2025-03-09 22:03:43 at Duplex.ondata (node:internal/streams/readable:1009:22)
2025-03-09 22:03:43 at Duplex.emit (node:events:518:28)
2025-03-09 22:03:43 at addChunk (node:internal/streams/readable:561:12) {
2025-03-09 22:03:43 code: 5
2025-03-09 22:03:43 }
(I’ve verified that the username & password are set correctly in the file)
–
Edit, got it working.
It just needs the format of
const clientId = "client_${MQTT}"
const password = "${MQTT}"
Where ${MQTT}
is just some random shit.
I’m gonna update the images on dockerhub so ${MQTT}
will just be some autogenerated/randomized ID for you.
THEY ARE LIVE NOW (Updated tagged
1.0.0
& latest
)
Instructions (no change): FOSSiBOT integration - #18 by InstantCasette
I did have the nasty surpise of the F2400 being disconnected from wifi and refusing to reconnect until I rebooted it by unplugging everything and holding the power button. When that happens you’ll only get one response message from the server with the last known state. All other requests e.g. :
Published XX,X,X,X,X,XX,XXX,XX to topic 'XXXXXXXXXXXX/client/request/data'
will go unanswered.
These two are also handy to have just for diagnostic purposes:
sensor:
- name : "Fossibot F2400 (1) Last Connected"
unique_id: "fossibot_f2400_1_lastconnected"
device_class: "timestamp"
value_template: '{{ (value_json.last_connect_time / 1000) | as_datetime | as_local }}'
- name : "Fossibot F2400 (1) Last Disconnected"
unique_id: "fossibot_f2400_1_lastdisconnected"
device_class: "timestamp"
value_template: '{{ (value_json.last_disconnect_time / 1000) | as_datetime | as_local }}'
Which can be used in a markdown card like so:
type: markdown
content: >-
<center><b><font size=5>🔋 Fossibot F2400</font> (1)</b></center><br>
<center>
{% if states('sensor.fossibot_f2400_1_last_connected') <
states('sensor.fossibot_f2400_1_last_disconnected') -%}
⛔ Disconnected from Wifi {{ relative_time(as_datetime(states('sensor.fossibot_f2400_1_last_disconnected'))) }} ago
{%- else -%}
✅ Connected to Wifi {{ relative_time(as_datetime(states('sensor.fossibot_f2400_1_last_connected'))) }} ago </br>
last updated {{ relative_time(as_datetime(states.sensor.fossibot_f2400_1_total_output.last_changed)) }} ago
{%- endif %}</center>
This way you can know if your battery was disconnected from wifi and if connected when the last update was sent to HA.
You’ll also want to add state_class: "total"
so you can track statistics of the battery level (soc), total input & output as well as add device_class: "energy"
so it can also be tracked in the HA energy dashboard.
- name : "Fossibot F2400 (1) Soc"
unique_id: "fossibot_f2400_1_soc"
device_class: "energy"
state_class: "total"
unit_of_measurement: "%"
value_template: '{{ value_json.soc | float }}'
- name : "Fossibot F2400 (1) Total Input"
unique_id: "fossibot_f2400_1_totalinput"
device_class: "energy"
state_class: "total"
unit_of_measurement: "W"
value_template: '{{ value_json.totalInput | float }}'
- name : "Fossibot F2400 (1) Total Output"
unique_id: "fossibot_f2400_1_totaloutput"
device_class: "energy"
state_class: "total"
unit_of_measurement: "W"
value_template: '{{ value_json.totalOutput | float }}'
Note that when changing this HA needs to be rebooted and those sensors will only become available in the statistics cards after HA has been fully booted and some data has been recorded. (minimum period of 5 minutes)
Hi all,
really appreciate this work. Awesome to see a way of integrating Fossibot devices into HA. Still failing to get this installed (placed it under custom integrations), but not sure from where to run the according .js - wasn´t working when I tried at the terminal. Any help on that? The SOC would be the main interest. Won´t use any registers, cause I sure don´t wanna brick it . Is some “official” integration (i.e. using HACS) still under development?
BR
Sven
Hi!
I wanted to share a custom integration for Home Assistant that I’ve developed for Fossibot power stations. This integration is based on code originally created by @iamslan, which I’ve adapted and expanded with the help of AI to create a proper Home Assistant integration.
DOWNLOAD: LINK (expires in 1 week)
Features
- Works out of the box as a proper Home Assistant integration
- No additional setup required beyond configuration
- Full integration with Home Assistant entities and services
Known Limitations
- After some time, the integration may stop polling data and working. I tried to improve the reconnection logic with AI assistance, but sometimes it still fails to reconnect.
- I’ve noticed that reconnecting the Fossibot to the network helps resolve connectivity issues. As a workaround, I created an automation that disconnects the power station from my Unifi network every hour. With this trick, in the last week it only stopped working once.
- I believe some property mappings in the original integration might be incorrect, as my AC output/input ON/OFF values are not registering the correct state.
Contribution Welcome
If anyone wants to take this code and improve it, fix the issues, or even build a proper HACS integration, you’re more than welcome to do so. All credits go to @iamslan for the original reverse engineering work and to the AI that helped refine the integration.
Instructions for installation and configuration are in the README file. Use at your own risk, and I hope you find it useful!
AWESOME!
Thank you so much for sharing that. Placed all under Custom Integrations, restarted HA, added that Fossibot integration, typed in my user name and pwd - and it works like a charm
That´s really cool…
BR
Sven
What is the username ? I have tryed my email and change the username in brightems app, nothing works. Cannot log in
Registratore: custom_components.fossibot.sydpower.api_client
Fonte: custom_components/fossibot/sydpower/logger.py:37
Integrazione: Fossibot
Prima occorrenza: 16:52:06 (42 occorrenze)
Ultimo accesso: 17:05:45
- Login failed - no token in response
- API call failed (attempt 1/3): Login failed - no token in response
- API call failed (attempt 2/3): Login failed - no token in response
- API call failed (attempt 3/3): Login failed - no token in response
The same login credentials used at the brightbms app should work, at least they did for me.
Great job!
I’ll try to take some time to continue the work on this.
I have already found a lot of issues and have fix for them (polling rate should be lower or battery hangs and you need wifi restart, IP ban or endpoint change for mqtt requests abuse, etc…)
I’m also checking about flashing a custom firmware on the embedded ESP32, because I really need charging power change remotely and it is currently only available by turning the knob physically… but this will require opening the battery.
I’m quite happy seeing all of you using my researches, lets continue the work to get something stable and well integrated in HA.
Thanks!
We started working together with @alessandro_lac to offer a plug&play integration.
You can install it and get updates from: GitHub - iamslan/fossibot: HomeAssistant integration for Fossibot batteries
Developers or testers, please join our discord: Fossibot Home Assistant integration development
I have just installed the integration via HACS. It works perfectly with F2400.
Thank you!
(I have one more problem: I can’t create a Statistics Graph Card about the battery charge level, because it can’t find the entity.)
While selecting AppleLogin as the login method during the initial setup, a long email address and a password with more than 18 characters are provided.
These login credentials do not work with the FossiBot integration.
One possible workaround is to unbind the device, create a new account, and then add the device to the new account. That worked quite well for me.