Emailing a "status report" for room temperatures every hour


#1

New to rule machine, so I'm struggling a bit to construct the logic, and wasn't sure how to create some kind of "export" of data.

My house is unevenly heated, so I've added temp sensors to the bedrooms, hoping to use that info to balance the system with the HVAC supplier. I want to see when each room is getting hot or cold, and what the temps in the other rooms look like. I currently have a 5-7 degree swing in each room. I get alerts when its either too hot or too cold.

I don't want to have to log in to a dashboard every hour to grab a screen shot or copy sensor data.

What I'd like to do is have an hourly status report that gets emailed showing the readings from each of the temp sensors. I presume there's an easy way to do this that I just haven't discovered yet.

Thanks in advance for the help!


#3

There is no built in way to do this in HE. The easiest way to do it is with NodeRed. We have a thread going on about using NodeRed with Hubitat:

Basically, you can do this easily with the following flow (which should only take a few minutes to setup):

If you want help setting up NodeRed, pop into the above thread and there are a bunch of us that would be willing to help you out. :smiley:


#4

And there's also @bptworld's Device Watchdog, but I don't know if it sends emails or not. It will log to logs and there is a dashboard tile that will give you the data.

(Sorry @bptworld, I forgot about your app) :smiley:


#5

Device Watchdog won't do this either. It doesn't handle temperatures. I could add something to track temps but it would use Pushover and not email.

Snapshot handles temperatures but the OP stated he doesn't want to have to look at a dashboard.


#6

I don't "want" to, but if i "have" to, then I guess I'll suck it up. Wasn't aware of SnapShot, so i'll check that out. As long as I can get hourly data, I'll figure out how to use it.

I was just hoping there was an easier way to do it.

Thanks!


#7

I was reading that thread before I posted for help here. It was a bit over my head, but I could probably slog through it. Your directions are so clear, that my lack of knowledge might not get in the way if i can "just.follow.the.directions."


#8

For this particular instance, you really just need to install NodeRed and nothing else. What I posted above is literally 3 nodes that are all built-in (timestamp, http request, and email).

The only thing you need to setup on the HE side is the Maker API.


#9

Are you looking to have the report e-mailed once an hour or to capture the temperature entries once per hour?

I was thinking you would like to build a table - for example with rooms on one axis and days/times on the other axis and populated with temperature values . . . this could be provided to the HVAC folks to say "see, I would like to balance the system to avoid the swings that you see here!".


#10

Ideally, having a "status report" for the whole system that could be emailed at a set interval would be awesome.

But for my particular need, just having it capture the data every hour and dump it to a table / database that I could look at and/or export later would be more than adequate.

(I LOVE THIS COMMUNITY!)


#11

What would the http request be to pull all the temps (or any parameter) from HE?


#12

http://[your-hub-ip]/apps/api/[maker-api-id]/attribute/temperature?access_token=[your-access-token]

Replace [your-hub-ip], [maker-api-id], and [your-access-token] with the values from your Maker API. You can also replace "temperature" with any valid attribute (like battery, contact, motion, switch, etc).

:smiley:


#13

This is awesome thanks. I didnt see the attribute end-point documented anywhere. This opens up the Maker API to be properly useful from node-red.

Are there more undocumented endpoints do we know?


#14

Not that I have found so far. I'm hoping they also include a /capability/[capability] endpoint eventually.

@Patrick gave me the link. :smiley: I guess eventually it's going to be documented? LOL


#15

What would the use case be for this vs just getting the attribute?

Nothing more undocumented in Maker API. Just forgot to document that as it was a quick insert a few versions back... The idea came up, was already in Maker API at the time and figured I'd throw it in and document it when we released it. Well, apparently the later never happened...


#16

Being able to filter devices based upon capabilities. So, I want a JSON list of just those devices with the [insert capability here] capability. Right now, I grab the full list (/devices/all) and then parse it out and stuff it into a database so that I can filter on capabilities, attributes, etc. :slight_smile:

As an example, I want to grab a quick list of devices that support the PowerMeter capability:

http://[my-hub]/apps/api/1/capability/PowerMeter?access-token=[access-token]


#17

If NodeRed makes your want to burn everyone who uses it at the stake for witchcraft (you all must be witches...no one should be able to use that damn thing, it's just too confusing) and when you hear JSON you think of the Bourne movies, then you might want to try a much simpler implementation using IFTTT's Maker Webhooks. Using it, you could send an email or record the temp to a Google Sheets spreadsheet for review later. You just have to set up a Global Variable in Rule Machine and set up a periodic rule, setting the variable equal to the temp sensor. Then in the same rule, call the IFTTT maker webhooks link and at the end have "value1={VARIABLE}" substituting your variable name in for VARIABLE. Just don't use a space in the variable name as that will screw up the link.


#18

That sounds like an interesting approach


#19

Ok, did a little more reading on webhooks (first timer here!) and I have a (probably stupid) question.

What is the event to call the webhook? The periodic rule that would poll the temp sensors?

Otherwise I get the jist of it and can do a little Googling and a lot of trial and error to make this work. IFTTT would work fine, because I don't need the rule to run in real time. As long as it dumps the data into a google doc, I'd be in great shape.


#20

Yup...you actually set up a Trigger with the trigger of Periodic. Then set the condition to every hour. the IFTTT maker webhooks is a bit of a pain to get the link from...you have to go into the service and click on "Documentation" and it will give you your link with your key. If you run into trouble, I'd be happy to give you screenshots of mine.


#21

finally got my temp sensors delivered and set up.
I'm not quite understanding how to "setting the variable equal to the temp sensor."

I've got the trigger set for every 15 mins, but I'm not understanding where you set the global bariable to the temp sensor. When I go under "conditions" and choose the variable "SMKtemp" (the sensor in my daughters room), it asks to set the variable as "=" or "!=" or "<" etc.

And I'm annoyed as hell that you can't seen to "go back a step" when building a rule, so I have to start over with setting the new trigger each time. Frustrating, because I know I just need to poke around. Took me 20 mins to find this....

So I'm getting warmer, but not there just yet. Not clear what is supposed to go after the /trigger/ of the webhook url. Is it the name of the rule? "15minTemps"?
image

I presume to call the webhook, I need to paste it into the "send http request" action?

Just not clear on how to incorporate the variables into the web call. When I tested the trigger in IFTTT, it fired successfully, but I don't understand how to write the full URL and append the variables into the string.

image