I want to automate different things with my car.
my car is a Kona Electric. It’s connected to HA through the custom Hyundai Bluelink Integration installed with HACS.
This integration gives me the location of my car.
I would like to use this location to get the current temperature, put this temperature in a sensor and be able to use it in some automations specific for my car’s location.
all my automation are working fine. but I’m currently using my home temperature (which I got through the openweather integration). I would like to update a temperature sensor for my car’s location while keeping the current sensors for my home location (which I’m using for other automations).
I’ve not used OpenWeatherMap for a while, but can’t you just use this API call in a sensor with the latitude and longitude from your car? Don’t touch your OpenWeatherMap integration for you house, this is just an additional sensor in HA world.
thank for the advice! It could work.
but I guess I’ll have to build a template to “extract” the current temperature.
the only part I don’t like is to “program” this myself… I never did this… it shouldn’t be very hard.
after all those months, my home assistant is near perfect (for my usage). time to learn a new trick!
Yes you may end up going down the rabbit hole of creating your own sensor. As @nickrout points out, about halfway down the list of examples for the RESTful Sensor documentation he references, there is an example querying OpenWeatherMap for your own sensors. Yes, this can be a ‘fun’ learning part of your home automation experience, if you have sufficient quantities of time, & .
thank you @nickrout and @dproffer for the suggestions! I really appreciate it.
I still do not know how to do it… but at least, I know where to start! (and yes I have time to do it on the weekend… I get up at 6am while my wife is sleeping until 9 or 10am )
when using the restful sensor and template, will the sensor be updated automatically? if yes, how often?
if not, I guess I can use the HA update entity service?
apparently it updates every 10 minutes which is fine.
so I got my sensor working with a fixed latitude/longitude.
I’m trying to get the latitude/longitude from the location sensor for my car.
I’m using this… which does not return the temperature on sensor.tempextkona sensor.
but if I replace state_attr with the actual lat/lon, it work fine.
If I use the same ressource string/url in dev tools/template, I get a proper url that works fine in my browser.
Am I missing anything? should I “encode” my url differently?
I get this in the log :
2022-02-25 15:14:51 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: ‘None’ has no attribute ‘temp’ when rendering ‘{{ state_attr(‘sensor.owm_report’, ‘main’)[‘temp’] }}’
sensor stays at “0”. when I put the real latitude and longitude in my ressource, it shows the correct temperature.
it looks like it doesn’t get the lat/long through state_attr.
Hi,
I have a Kia EV6, and I want to do exactly the same thing.
unfortunately I can’t get your code to work.
when I manually enter the link, it works fine.
I come from the Arduino world, I still have a lot to learn in YAML and JSON.
It will work until’ 2.5 api is deprecated.
You either have to switch your code to 3.0 and possibly have to pay if you do a lot of requests or find something else.