How to set states value in google sheets

Hi there,
I’m quite new in Home assistant and not firm in YAML at all.
My problem is, how to get out “simply” ONLY a value of an sensor, without all the restfinformation, because I want to write the consumption of the tumble dryer to google sheet every day at 23:59. Google sheets is already working fine, but it records all the data, I do not need.
I tried it with
{{ states (‘sensor.tumble_dryer_energy’) }}
and homeassistant gets back an novel instead of just saving the value
Thanks a lot for your help.

states() should return what’s in column 2 of developer tools → states.

and usually that is quite terse… not novels.

I’m not familiar with what that particular sensor of yours gives.

can you go to dev tools → states and verify the the states column is what is getting written out? If it’s not, your doing something wrong.

if it is, but you want something different, please put a screenshot of that whole row and tell us what you want it to say… if the thing you want is in that row, we can get it…

Is it that, what you mean?

The aim is, to get out the 11,46. The sensor is a Bosch Compact Plug also calculation the consumption and showing the wattage.
Thanks a lot

I meant scroll down on that same page… find that sensor via scrolling it there’s a filter at the top of the columns…

however, that does seem to indicate 11,46 should be what you get with states()

what do you get instead?

And particularly if you put {{ states (‘sensor.tumble_dryer_energy’) }}
Into the Dev tools → template page what do you get?

Hallo armedad,
this is the particular sensor. In my question I named it english just for example, so that everybody knows, what i mean.

please post your code. and be sure you mark it with the pre-formatted text so that it is readable.

That is, what i put in:

And that is the result in google sheets:

ok, now I’m confused. your original post said that you are getting a novel… that you want just the simple info and not include all the rest of the information.

Hallo armedad,

ok, not a complete novel, but all informations I do not need ;-). And the main thing, the value is missing. Sorry.


energy: "{{ states ('sensor.tumble_dryer_energy') }}"

ugh. please grab that code line again. i just noticed that what you had posted way above had mac “pretty quotes”… instead of ’ quotes. I just fixed it. so please make a new copy

energy: "{{ states ('sensor.tumble_dryer_energy') }}"

and try it again.

and then also hit zum yaml-modus and share what the yaml is.
i’d prefer if you share the yaml by hitting pre-formatted text and copy/paste it in instead of doing a screen shot. please don’t do screenshots of code. that’s not as useful as proper copy and paste (with pre-formatted text selected)

1 Like

Hallo Armedad,

that worked out!!!
the YAML is now that:

I do not know, how to paste a formated YAML Code, sorry.

the result now is that, and it’s fine!!

Thank you a lot.

great! i’m glad it works for you!

in case you need to ask more questions in the future, see section 11 here to know how to paste in code properly:

Hallo Armedad,
I will keep that in mind. Hopefully I can help others in the future, as well. But I think, it will be a long way there for me :-(.
Thank you for your help