I know you’re getting frustrated, but holy moly, you’re frustrating to help. You literally need to copy/paste the template he asked you and you aren’t doing that.
Ok, the entity is not being created at all. Are you restarting after you add compensation? Secondly, there will be an error in your logs if it’s not set up properly.
Also, are you sure the file you’re adding the compensation: to is the correct one? We’ve had cases before where people accidentally edit a backup file or something.
Make sure you only have one compensation: heading in the file.
My configuration.yaml is totally default and configuration isnt used in any other yaml file.
I’m using a freshly installed HA instance.
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
compensation:
ble_battery_charge:
source: sensor.bthome_sensor_0001_count_1
unit_of_measurement: "%"
data_points:
- [50, 0.0]
- [105, 100]
I always restart after a config change and find anything related to this in any log.
If you want I can send any log you want, just tell me which one.
Thanks for your help and patience so far.
Logs are disappointingly empty.
This is from home-assistent.log after a restart, which is the same as the HA Core log:
2023-06-16 15:09:16.595 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-16 15:09:18.320 WARNING (MainThread) [homeassistant.components.ssdp] Could not set up UPnP/SSDP server, as a presentation URL could not be determined; Please configure your internal URL in the Home Assistant general configuration
2023-06-16 15:09:32.409 WARNING (MainThread) [homeassistant.config_entries] Config entry 'GW' for devolo_home_network integration not ready yet: Unable to connect to 192.168.10.183; Retrying in background
2023-06-16 15:10:54.086 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.10.195 (192.168.10.195). Requested URL: '/auth/login_flow/d021aeed6aaa369699f13e6b7c65e97b'. (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36)
Are you filtering your logs to only show warnings?
EDIT: Are you 100% sure there isn’t a compensation entity? Have you looked in your developer tools → states page? It does not build the compensation entity off the slug used in your configuration. I’m starting to recall that the main development team wouldn’t let me have the user set the name. Looking at the code, the name will be:
Compensation sensor.bthome_sensor_0001_count_1,
so the entity_id will probably be something stupid like sensor.compensation_sensor_bthome_sensor_0001_count_1
Well 106 is above your last number. Unfortunately, it doesn’t truncate results, that’s a pending PR. You could increase the degree and add more data points to try to keep it between 0 and 100%.
Great! sensor.compensation_sensor_bthome_sensor_0001_count_1 shows up with a value of 99.3, ble_battery_charge unfortunatly, does not.
I’m experimenting with some code now to round it off in steps of 10 so I can make a battery icon depending the battery level.
I’m waiting for a PR to be added so I can put in another PR to allow device classes for these entities. It’s taking forever, maybe it’ll be done within the next couple months.
@petro
Something strange happened. After a restart other compensation sensors appeared out of nowhere.
What makes it even more confusing is that after a restart one of the 3 has a value, the others are unavailable. Do you have any idea what causes this?
Is there also a way to get rid of the trailing .0 after 100? I added precision: 0 to the compensation, but no effect.