platte-73
(Platte 73)
April 7, 2023, 11:25am
1
I use the template number to set rgb value for a ledstrip. Have the value red, green and blue
But when I pass this to homeasstistant the value’s are shown with a comma. See picture.
Is it possible to get rid of the comma
number:
# red value
- platform: template
name: "1.Red"
id: rgb_r
optimistic: true
mode: box
initial_value: 255
restore_value: True
min_value: 0
max_value: 255
step: 1
# green value
- platform: template
name: "2.Green"
id: rgb_g
optimistic: true
mode: box
initial_value: 255
restore_value: True
min_value: 0
max_value: 255
step: 1
# blue value
- platform: template
name: "3.Blue"
id: rgb_b
optimistic: true
mode: box
initial_value: 250
restore_value: True
min_value: 0
max_value: 255
step: 1
Kimotu
(Kimotu Bates)
April 7, 2023, 8:51pm
2
Try accuracy_decimals: 0
Detailed description: Sensor Component
platte-73
(Platte 73)
April 8, 2023, 7:15am
3
It won’t compile when I put it in
[accuracy_decimals] is an invalid option for [number.template]. Please check the indentation.
Kimotu
(Kimotu Bates)
April 8, 2023, 7:40am
4
Ah, my fault. I was at template sensor, not template number.
The values are defined as float. Didn’t find an option to cut decimals. Sorry.
platte-73
(Platte 73)
April 8, 2023, 8:14am
5
My goal is to send a RGB value like 255,255,250 now I defined a Red a Green and a Blue. Maybe I need a different approach for doing this
Kimotu
(Kimotu Bates)
April 8, 2023, 9:18am
6
Isn’t it just a cosmetic issue? Since your step value is 1, the values are all integer.
platte-73
(Platte 73)
April 8, 2023, 9:29am
7
Yes it is only cosmetic, but is was nice to see that the numbers were rounded.
If I look in HA for other number value’s for example my Sonos system. You see that the level for bass is a rounded number