Possible health report

Hi cleaver people, I have a amazing automation using open weather map and get it to trigger in the morning to get a report.
I was wondering if it would be possibly to create a automation that was similar, I have a couple or withings sleep mats and was hoping it would be possible to get a report for my mum regarding health using the mat, I have tried to replicate the automation that was taught to me on here but I can't make it work with the mat. It's possible I have forgetting something and I am doing something wrong?
If this type of thing is possible would it also be possible for the automation to react to health if for example my mum had a unrestful night sleep, the automation could follow with recommending to get some rest?
If this is to far it would still be great just to get a basic report if someone could give me a few pointers to remind me how this is done please, that would be great thank you

I’m not quite following what you want to have happen.

Maybe it would help to share a screenshot of the automation you’re using for your weather report, and what you’ve worked on so far for your health report automation.

Looks like your weather device has a summary attribute with all that info, and your rule machine rule sets a string variable to that attribute, which you then use to speak a message on your Sonos speaker.

You can do something similar with your Withings sleep pads. Create new string variables for whichever sleep pad attributes you want to use, then in a rule machine rule, set those variables to the corresponding attribute states. Next speak a message with the attributes of interest, using the %variable% tags you have just created for each attribute.

looks like I almost understand what I am doing lol

can't get it to speak tho, and for some reason

had to work it out,
I just need to try and get a reasonable sentence out of the info now lol

Looks like you’ll need more than one variable to accomplish what you want.

For example, create variables mumhealth1 and mumhealth2.

Then in your rule actions, set mumhealth1 to sleepQuality, and mumhealth2 to deepSleepDurationDisplay.

The message to speak would then be something like, “Good morning mum, last night your sleep was %mumhealth1%. You were in a deep sleep for %mumhealth2%.” Or something like that.

I come up with this

it doesn't seem to be working at the moment tho?
I noticed in the device attributes there is a overall sleep score but it doesn't seem to be available when trying to add a variable, I was thinking if I could get access to that I could make a second rule with set messages for a sleep score below 50 and one for above 50 and one for above 80 that would be cool. Almost like Tony stark lol

this works great, I just need the next step using the sleep score,
any advice on getting this one working for me please

I think you could do that in a rule with another variable and some conditional logic in the actions.

Set the new variable to the sleep score as a number (not string like you did previously).

Then create some if/then statements.

If %sleepscore% <50, speak sentence a
If %sleepscore% between 50 and 80, speak sentence b
If %sleepscore% >80, speak sentence c

1 Like

thank you so much I will give it a go, I have the first part of the automation ready to go, hopefully she will like it and get some smiles in the morning :blush:

1 Like