-
Notifications
You must be signed in to change notification settings - Fork 124
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
ip5306 #45
Comments
In order to see setup messages, you have to watch the serial logs over USB. |
Ah, yes, that works. I also found out the battery level only updates on a device reset. |
As the battery level only updated on a device reset, I've changed the component from Component to PollingComponent. The diffs: ip5306.h
ip5306.cpp
|
what device are you using? I think my m5stack fire gets battery level updates with the current implementation but I'll check to be sure |
Hi, I've activated the ip5306 on my T-Journal as stated in https://discord.com/channels/429907082951524364/951213660905287761/1061049798402265228 . It looks like |
I don't see what that PR fixes. The current code will update when the battery level changes. If that's not working, then polling is not going to work either since it's still the same code. |
The code only publishes on a device reset. Or maybe when the battery level changes, i've not seen this happening. This means when Homeassistant restarts there is no value reported and it's shown as NA. So changing it to a PollinComponent that reports the current value on polling fixes this. Both changes work together. |
Hi,
I'm trying to use the ip5306 component, but it doesn't seem to work?
Config:
i2c:
sda: 14
scl: 13
frequency: 400kHz
scan: true
ip5306:
battery_level: # sensor
name: Battery Level
charger_connected: # binary_sensor
id: connected
on_press:
then:
- lambda: ESP_LOGD("TEST", "charging");
on_release:
then:
- lambda: ESP_LOGD("TEST", "not charging");
charge_full: # binary_sensor
id: full
on_press:
then:
- lambda: ESP_LOGD("TEST", "fully charged");
on_release:
then:
- lambda: ESP_LOGD("TEST", "still charging");
Logging:
[11:02:09][C][i2c.arduino:052]: I2C Bus:
[11:02:09][C][i2c.arduino:053]: SDA Pin: GPIO14
[11:02:09][C][i2c.arduino:054]: SCL Pin: GPIO13
[11:02:09][C][i2c.arduino:055]: Frequency: 400000 Hz
[11:02:09][C][i2c.arduino:058]: Recovery: bus successfully recovered
[11:02:09][I][i2c.arduino:068]: Results from i2c bus scan:
[11:02:09][I][i2c.arduino:074]: Found i2c device at address 0x3C
[11:02:09][I][i2c.arduino:074]: Found i2c device at address 0x75
But nothing from ip5306, while I expected something from:
ESP_LOGD(TAG, "Setting up ip5306...");
I'm using esphome with homeassistant and the 'Battery level' entity is available, but at 0%
The text was updated successfully, but these errors were encountered: