HOW-TO Store data in Google Sheets directly from RM5

I don't know how's webCoRE would be doing this, and I just fired up and can't figure out where in thr UI that is even located (I tried creating an action to set something and a condition to check something and didn't see a way to look at state in either case). But to directly answer your question, I'm not aware of anything that has changed. I'm assuming you're talking about state or atomicState, not just device event history (sometimes also loosely called states). There is a way to get that history from an app, though at the platform level there is no guarantee it will actually be there (I think a user can set the history to store 1 or maybe even 0).

1 Like

Here's an example of how I got\used WC for state values.

Is that not just the value of the temperature attribute under "Current States"? If so, that is not state (or atomicState) in the sense of "State variables" as you'd see on the app or device page. It's just the value of an attribute, which you can already do with Rule Machine, though you need to store it in a variable yourself before you can use it as part of another expression.

This is what I see when I look at the driver for that Smartthings Motion sensor.

Yep, so those are "Current States," just the current attributes and their values. It is not state in the state variables sense, which I may have been referring to elsewhere (but without a link I can't say for sure). You can definitely read attribute value with Rule Machine or a custom app (or most stock apps if they need it for their purpose).

Very impressed! I’ve been wanting to collect Home Energy Monitoring data for a while, I think this will finally allow me to do that! Thanks!

The instructions were really clear and easy to follow. There is only one thing I had to do differently in the 6th bullet of Step 2:

For me, the instruction that would have shown what I had on the screen:
With Payload highlighted, you will see the data fields under Form Data

1 Like

I've gone ahead and edited the instructions accordingly. Nice catch!

1 Like

my 2 cents here.
I built my google sheet/form with your tutorial: OK !

I wanted to add a space between words in one field (door unlocked) but a regular space disable the update of the google sheet.

However, if I put a %20 between words (door%20unlocked),it works perfectly. Btw, I also noticed that accents (I also speak french) are allowed too.

2 Likes

I really like your find. But I'm lazy too.

Instead of using a lot of local variables, you put everything in one string, it's easier to build a new rule (copy/paste the get and modify string on the fly) that way. I also added a GoogleSheetActivator switch to enable/disable the update (if necessary).

1 Like

Thanks for the tutorial @LibraSun, just set this up for my better half's new mini green house to monitor temp and humidity compared to the outside temp/humidity before we actually start putting the plants in it!

1 Like

Hey all,

Trying to get this to work. I believe I am following the instructions, done it several times and still get the same result

The rule is populating the variable with the right data, however it doesn't seem to pass to the Google Form/Sheet

Here is the rule

Here is the sample form

And the accompanying sheet, which appears to be taking in the sample question data that I entered

Here is the RM Log

What am I missing?
Rick

Same exact problem here. If I paste the generated URL from my logs manually, it works fine. If I run the action from the rule, nothing ever shows up. Not familiar enough with making HTTP calls from RM to know how to troubleshoot this, tbh...

I feel honor-bound to chime in here, but it's only to say that I have no idea why that setup isn't working. Was it working before and only changed after a firmware update? Or did it never work from the beginning?

Wish I could offer better insight! Everything you did looks "right" to me. :-/

EDIT: Oh, good, I see you solved the problem (above). Congrats, and smart thinking!

1 Like

I figured it out. Had to allow public posting to my form (was originally set to just my GApps domain)

1 Like

I believe mine is set properly... no matter what I do, the form never gets updated

Form responses do flow into the GS, but can't get updates from HE to get into the form

Since this is the first time setting this up, I can't comment on previous versions

Are you completely certain that your Google Form is set to "Accepting Responses"? Not sure how else I would go about troubleshooting, except your posted screenshot shows everything greyed out, which made me think of the "Accepting Responses" switch. Just double check that first, I guess.

Yup

if you open a browser in incognito mode (or sign completely out of Google), can you paste the generated URL from RM and it will create the row?

Yes, that worked well

So what else might I be missing?

Here is my test RM Rule

1 Like