This also may be resolved by using the custom preloader card. https://github.com/gadgetchnnel/lovelace-card-preloader
Thanks @firstof9, unfortunately I was not able to get that to work. I have instead created a work around within Gmail and sent all delivery emails, including Amazon to a new folder and I will just monitor that folder.
Do you think it would ever be possible to display a tracking number and itās estimated delivery or just make a link to that carrierās website with the tracking loaded?
In the beta Amazon order numbers are exposed as an attribute of the sensor, you should be able to manipulate that data into a link.
Currently all my amazon emails go to a different email then the one I am using for this component, would forwarding them to this email work or is that ganna cause issues if the subject line now includes āFWDā?
The integration looks for the email address amazon uses and the subject line. Forwarding would not work out of the box. You would have to modify the const.py file and be conscious of that when upgrading to future versions.
Thatās what I assumed, I was hoping to avoid having to change my amazon email since I think it will change the login but if the amazon sensor makes its way into the main version I probably will as amazon accounts for alot of packages. As always thanks for helping
Setup IMAP on the emailbox your Amazon emails currently go to, then have your mail system where you check email now pull those emails.
I did something similar when I shifted from my old Yahoo mail email to my Gmail many many many years ago
Hmm that sounds like it should work as they are currently going to yahoo mail. Iāll give that a try thanks for the tip!
So Iām stupid and didnāt think for myself and blindly read the setup instructions, but think the Hass.IO instructions should be pointing at config/www/mail_and_packages not an images folder. Wasnāt working for me for a bit and I went back and read and was able to fix it. Working great now!
This was changed due to https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/issues/70. It should be fine so long as you update all the paths to match for any sensors/cameras.
With the latest beta update, how would I send the gif using the new state attribute? Iāve been using Node Red to send it to Telegram every morning but now I have no idea how to replicate it.
I understand this was done for privacy reasons and Iām okay with that, I just need to find a way to make it work again using NR, if possible.
Not sure about how Node-Red pulls data but internally in Home Assistant youād use:
state_attr('sensor.mail_usps_mail','image')
to get the image file name.
Plans to make it a toggle are in the works. (Enable/disable random filename)
Use an inject node connected to a get current state node. Finally attach to a debug node with full message.
Inject and youāll get everything from the sensor.mail_usps_mail
entity. You should be able to dig through the attributes and find the correct topic for image.
I havenāt updated to the newest version yet - might tomorrowā¦ if/when I do Iāll try to update this thread with it.
Thank you, that helped me get the camera image updated within Home Assistant but not sure I can use it in Node Red to send the GIF. Still trying to figure it out.
That would be great, if you do decide to update. Iām very new to Node Red so not quite sure what to do with all the data I get from doing what you suggested. Iāve tried using a switch node but I think I have the JSON wrong.
On the first side of the screen just look at the debugger.
You should be able to expand and eventually find the imageā¦
I havenāt had time to update, but here is an example of what it looks like before updating.
I expect the attribute is where youāll find itā¦ but youāre looking for an image tag:
Yup thatās as far as I got. No clue where to go from here.
Awesome, thatās itā¦ you can see your image thereā¦ so next to it there is a clipboard that will copy the path or the valueā¦ copy the path and you can use it elsewhere.
So, where ever you want to put the image name, use {{data.attributes.image}}
.
OR if you are using a function node, its msg.data.attributes.image
.
I believe this is because other nodes use mustache template, but function node does not.
Hope that helps!
DeadEnd
This should work @Jeremy_S . It wonāt catch if thereās no mail, I gotta work on that. (SEE EDIT) TBH Iāll probably just disable the random image name as I donāt really need it since the path for me isnāt public anymore. Hope thatās coming soon @firstof9
[{"id":"916e36b5.b8b428","type":"api-call-service","z":"1fe83a7f.e0f0b6","name":"Update Image","server":"63517380.eb951c","version":1,"debugenabled":false,"service_domain":"local_file","service":"update_file_path","entityId":"camera.usps_mail","data":"{ \"file_path\": \"/config/images/mail_and_packages/{{payload}}\" }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":420,"y":1700,"wires":[[]]},{"id":"f1eae158.c7849","type":"api-render-template","z":"1fe83a7f.e0f0b6","name":"Test","server":"63517380.eb951c","template":"{% if state_attr('sensor.mail_usps_mail','image') == None %}\nmail_none.gif\n{% else %}\n{{ state_attr('sensor.mail_usps_mail','image') }}\n{% endif %}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":250,"y":1700,"wires":[["916e36b5.b8b428"]]},{"id":"c44bdd94.af8dd","type":"server-state-changed","z":"1fe83a7f.e0f0b6","name":"Camera Update","server":"63517380.eb951c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.mail_usps_mail","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":100,"y":1700,"wires":[["f1eae158.c7849"]]},{"id":"63517380.eb951c","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
EDIT: Ok I figured out how to do the mail_none.gif bit using a template node. Youāll need to have the mail_none.gif in the same path as your mail_today.gif (or what WAS mail_today.gifā¦). Code above is updated to reflect the change.
EDIT 2: Nope, not working @firstof9 Iām using your suggestion here https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/issues/70#issuecomment-610675419 but the problem is the image path seems to update more frequently than the sensor, so with there being no change to the sensor itself, the image path isnāt updated so the camera entity is broken. Gonna revert for now until the disable switch is available.
The image file name changes each mail check and the attribute is updated along with it.