Not with the built-in send email action. You can, as FlyingDiver suggests, use a script. I'll simplify and comment heavily here:
- Code: Select all
# Get your weather station device - use the ID rather than the name since the name can change.
myWeatherStationDevice = indigo.devices[IDOFWEATHERDEVICE] # insert the device ID between the brackets
# Get the state values you want to use - you can find the state IDs by selecting the device in the device list of
# the client then expanding the control area below the list until you see the list of custom states.
someState1 = myWeatherStationDevice.states["someStateId"] # enter the state ID you want to use in the email
someState2 = myWeatherStationDevice.states["someOtherStateId"] # enter the state ID you want to use in the email
# Subject of the email
theSubject = "Subject of the email goes here"
# Create the body of the email - add %s everywhere you want to do a substitution
# Follow up the body string with a % and a list of values to insert into the string - the list must have the same number
# of items in it as the number of %s values in the string itself.
theBody = "Body of the email goes here. Use 'percent-s' where you want a value entered, like this value: %s. Here's another value: %s." % (someState1, SomeState2)
# Send the email
indigo.server.sendEmailTo("EMAILADDRESSHERE", subject=theSubject, body=theBody)