Set counter value

Hello,

I need to be able to set a specific value to the counter based on an sutomation which checks for certain conditions.

I can use the decrement/ increment but this will involve running this script multiple times until I get the right value. It would be easier to check if the value was above/below a certain value and then set the value required.

Hi @uiguy, maybe use this:

It works great and you can set any states/attributes you want.

HI, Thanks for the feedback, this looks good Have you considered doing a PR into the HA core? Ideally, I want to limit the amount of custom components. Additionally, I was also hoping to possibly guage interest and then request the feature request in the counter component.

I will look into it a little more this evening. Thanks again for the help,

Well, I don’t know what to say.
I like the idea of being able to set a counter to a specific value (other than just the next one or the initial value (having to use an Input_number instead for the moment)) BUT I also think that “Custom Component To Declare/Set Variables” is generally such a sensible idea it should be endorsed generally and added to HA core soonest. How long does such normally take ? I have been waiting for the “input_number box issue fix” to go in since before the release of 0.61
Cheers
Mutt