Need some help with my automation

Hello
A few year ago i had a automation thats calculte the average humidity.
I didn’t use it for some time, now i can’t get it to work. Maybe some things are changed.
Can someone take a look of it?

this is my automation

alias: Luchtvochtigheid berekenen
trigger:
platform: time
minutes: ‘/10’
seconds: 00
action:

  • service: variable.set_variable
    data:
    variable: gemiddelde
    value_template: ‘{{ (float(states.variable.gemiddelde.state) * 0.9 + float(states.sensor.Thermometer_douche_2.state) * 0.1) | round(2) }}’
  • service: variable.set_variable
    data:
    variable: limiet
    value_template: ‘{{ (float(states.variable.gemiddelde.state) + 5) | round(2) }}’

Please format the YAML code so we can read it properly.

Also, you must be getting an error. Have you looked?

Lastly, the time trigger was split into two different triggers quite a while ago. Please read the docs on the time and time_pattern triggers.

Sorry but how can i format the code as YAML?

Yes i think it was 2 years a go i used that code.
I will read the docs.

Naaa, wrong mate

one can still use ‘/n’ for every ‘n’ minutes [or hours using hours: '/n’

so his minutes: ‘/10’ is valid
BUT
his seconds: 00 is not. Use seconds: 0 (he’s not reading that link you gave him!)

also
variable is a custom component [aka Integration], so I take it @Jovink that you still have the component’s variable directory under your /custom-components directory.

AND
and this is my REAL grunt here @Jovink.
R.T.F.M !! in terms of asking a good question, because:

  1. Your formatting is ridiculous. bound it using the </> on the menu bar
  2. Provide all associated information, in your case the definition of your gemiddelde, also limiet, your homeassistant.log file, your logger.yaml if using it,
  3. You should now be using is_state(‘variable.gemiddelde’ , ‘<state-value>’) and not states.variable.gemiddelde.state . As per here:https://www.home-assistant.io/docs/configuration/templating/

So I guess you’re lucky me n @pnbrucknet replied ! :slight_smile:

Sorry, but I’m not. The time trigger no longer accepts parameters minutes & seconds. It only accepts at. He needs to change time to time_pattern.

I don’t see where that matters. Either should work.

1 Like

Em NO
I am using ‘/10’ right now and works perfectly.
Maybe sort your setup out L:)

p.s

I don’t see where that matters. Either should work.

Well maybe you need to R.T.F.M too then
hahaha

see here:

for this

sorry, just been watching a serious documentary on TV
just needed to burst out and have some fun L:)

EDIT:
Think I will just check that ‘/10’ time pattern - I may not be using that automation any more as I do not have the hue bulbs - oops - you may be right !!?

1 Like

Ninjadog, this is only the second time I’ve seen you post and that makes 2 out of 2 where you have insulted a valued member. BUT this time a Great Contributer too. @finity being the first.
Please try to consider the feelings of the OP. Who is just starting out and is learning.
We ALL start somewhere and we progress at our own rates.

I see you joined a couple of months ago and have read a whole 19hrs

Dial it back a bit and be more considerate

P. S. Phil is a great contributor because he wrote code in HA (a few core integrations) - and often takes the time to politely help others.

This is my first post (and problebly the last one), but I’m verry happy with both of the reply’s.
I still have a lot to learn.

So that’s also not good . Also my English is not good so it takes some time before i reply :slight_smile:

But again thanks for the reply’s. I wil study the links you posted.

Jovink, I’m sorry about this thread, people are not all as rude as ninjadog.
Phil is a good guy and a great help to many here

Welcome to the community

:rofl:

1 Like

@Mutt , you need to get out more mate , and bit of a stalker too , monitoring and measuring me - wow that’s worrying .

I used to know a guy at work who spent hours and hours and days and months , on forums posting comments about other people’s posts. He didnt really make much contribution other than to seek to educate on how others should “behave”. He was rather weak physically although mentally he was quite “bright” - but as most of these anorak types , he did possess a social bypass system. He was banged up at HMP for stalking a woman. But here;s the funny bit - and I’m all for fun - his name , was Murtley … so close … hahaha

Go for some fresh air mate , it might help you cool off , calm down - COVID19 is too much of a pressure at the moment

Ha ha ha ha ha,

If you want to insult me you’re gonna have to do a lot better than that.

:rofl:

I never set out to insult anyone , although your handle does make me laugh - only as it reminds me of the dumb dog on Wacky Races, which I loved as a kid, and the laugh , I bet you dont do that too often , but it would certainly make me smile again :slight_smile:

EDIT:
I actually am wrong there - I think Mutley was the more brainy, cunning and astute one , over Dick Dastardly, if only cartoons were the same as life eh mate - :slight_smile: :slight_smile:

@Jovink, do not give up. Ignore me, I’m just being a bit wild tonight having watched a rather sad yet true 2 hour documentary on TV about a hospice here in the UK.
Your English is far superior to my [well whatever you speak, Nordic maybe].

1 Like

Mutt == Muttley
That’s what it’s supposed to remind you of, dumbass

That and we train assistance dogs, so - mutt

Being a happy drunk is fine - being an insulting piss-head is not

(I’m not the one who needs to calm down)

:roll_eyes:

Edit: Nordic ??? Do you make up language names of a evening ?
I see why ‘insulting people’ is a light relief

1 Like

I think you have outdone yourself there mate, Nordic, my mom is from Norway - it’s a true and in-use term
shhhh (google is your friend today - not that you have many)
And my mutt was a joke on you - dumbass - hahahah you couldn’t be more ignorant if you were born this morning.
hahahah - LMAO
Going to zzzz now, with a big :slight_smile:
So funny

Ok. Could you post that automation? And what version of HA are you using?

Although I can’t admit to understanding 100% of the HA code, I have worked on the automation code, so I’m pretty familiar with it. I know that in the current version (and for a while now), the time trigger does not accept hours, minutes or seconds for parameters, it only accepts at. To use the others you must use the time_pattern trigger platform.

1 Like
seconds: 00

is different from

seconds: '00'

The former is a number, the latter is a string. They are handled differently. The OP used the first form, and the note to which you refer regards the second form. Even so, I’m not sure that warning is valid, although I haven’t completely verified it either way.

Please see this post. It explains it pretty well (with many other suggestions for requesting help on this forum.) Skip ahead to item #11 which explains how to format code, logs, etc. in forum posts.

Why the last? Hopefully because you have everything working and you no longer require help! :smiley: But if you need help, please, by all means, ask.