int error, why ?
#734
Replies: 2 comments 2 replies
-
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)) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
melmager
-
ok my fault |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
how to work with Integer ?
Exception in <file.akku_steuerung.grid_strom> line 5:
akku = int(state.get('sensor.ms_a2_akku_ladung')) ^ ValueError: invalid literal for int() with base 10: '-199.9'
akku = int(state.get('sensor.ms_a2_akku_ladung'))
or
akku = int(sensor.ms_a2_akku_ladung)
both i get the same literal error ...
Beta Was this translation helpful? Give feedback.
All reactions