I was wondering if it could be possible to use templating in the configuration.yaml file. I would like to use this to setup dynamic weather data. I bike a lot, therefor it would be great to get actual weather data of the location I’m right at that moment. For example:
I get a notification when I have to go home before sunset (if I’m out of light for example).
And a lot more automations that only the darksky app can’t achieve.
Because he want to use a current state as a location to darksky and therefore needs to be possible to accept a template value as a longitude and latitude.
Well you aren’t going to be so far away that your sunset time is going to change, so I don’t understand why that would matter, or what that would change. You can STILL have that notification.
But HOME Assistant is for your HOME. I fail to understand where this is useful. If you want to know the weather for the location you are CURRENTLY at, use Darksky?
I know what he is asking. I’m not an idiot. I just don’t understand the benefit of it.
I don’t think it will work because the configuration file get’s parsed at load time. So even if templating was possible the values wouldn’t update without a restart.
If you are running Android I recommend Tasker for mobile device automation. As mentioned this is best done on device not trying to link back to your house. If you need something to happen at your house based on your mobile location there are ways to send messages from Tasker back the HASS to trigger events at your house. I actually use this method to do things like turn up the heat/AC when I am on my way home. No reason to walk into a hot house with a hangover after a long party weekend…
I’am not an idiot either, but I do understand the possibilities. When you can set the longitude and latitude dynamically as the position of your phone you can show for example the current weather based on your mobile location instead of a fixed home location. Think about travelers or people on a boat.
But you can get that data from apps that are already on your mobile device.
I travel. That doesn’t mean I want my HOME Assistant to display the weather where I currently am.
I have apps on my phone if I want to know the weather where I am. If I wanted HOME Assistant to know the weather where I am, there are a plethora of ways for me to get that data back to Home Assistant.
I think this is a different issue altogether. The request here is for DYNAMIC WEATHER LOCATION, not DYNAMIC HOME ASSISTANT LOCATION.
The boat example is an interesting use case. But rather than templating the config file, it would probably be better implemented by exposing the Lat/Long as attributes in dark sky and then allow those to be adjusted via automations. Unfortunately it doesn’t look like that component allows that today, but if you are handy at Python it could probably be done.
Yeah that’s an excellent idea, don’t forget about the Rest module it is very powerful, it can often do the same thing as the built in components. I replaced the defunct Weather Underground component with Rest templates after they changed their API and have been running fat dumb and happy ever since.
I have been looking for this for some time now. I am implementing this in a RV and would like to get current weather info as i travel.
I tried to add this, but i must be missing something as i can not get the configuration to check correctly.
It keeps giving me a invalid configuration.
is it possible you can assist and help me implement this .
I was reading this and thought that you could also do this in one go. Have a REST sensor that uses a value template to extract one value from the json output and create attributes with the sensor for other values.
In this way you don’t have separate sensors to show on the UI but just one for use in automations. This could be useful depending on your use case.
Is it possible to do it with the Met.no weather provider (the default one) I tried to use other weather providers but no longer accept new users or were paid services.