Skip to content

int error, why ? #734

Answered by ALERTua
melmager asked this question in Q&A
Jul 1, 2025 · 2 comments · 2 replies
Discussion options

You must be logged in to vote
sensor_state = state.get('sensor.ms_a2_akku_ladung')
sensor_state_float = float(sensor_state)
sensor_state_round = round(sensor_state_float, 0)
sensor_state_int = int(sensor_state_round)

# or just
akku = int(round(float(state.get('sensor.ms_a2_akku_ladung')), 0))

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@melmager
Comment options

@ALERTua
Comment options

Answer selected by melmager
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants