PineTime weather

Spent some time trying to figure out how to get weather details to my PineTime watch using only the official Home Assistant app vs having to have another weather app running as well.

There are still things to work out and this isn’t perfect but its probably a good starting point for some.

Below is the service call to tell Gadget Bridge via an Intent what temperature to pass over. This is also passing the humidity and some other info but there are only two things being displayed by the watch using the PineTime watch face ATM temperature and the currentConditionCode.

Things to note. The temperature must be sent in Kelvin. The temperature on the watch is always displayed in Celsius (PineTime bug I think?) the condition code is used to show sun/sun + clouds/just clouds but I don’t have a good way to get that info yet so its just hard coded 803 (partly cloudy for now) the data sent is JSON but it has to be url encoded.

I’m running this automation every 15 minutes and things seems to be working. There is a PineTime bug that can cause the watch to run out of memory and crash if too much weather data is sent so keep that in mind.

  - service: notify.mobile_app
    data:
      message: command_broadcast_intent
      data:
        intent_package_name: nodomain.freeyourgadget.gadgetbridge
        intent_extras: WeatherJson:%7B%27timestamp%27%3A{{as_timestamp(now()) | int}}%2C%27location%27%3A%27Home%27%2C%27currentTemp%27%3A{{((((states.sensor.outside_temperature.state
          | float) - 32) * 5/9) + 273.15) | int}}%2C%27todayMinTemp%27%3A0%2C%27todayMaxTemp%27%3A0%2C%27currentCondition%27%3A%27%27%2C%27currentConditionCode%27%3A803%2C%27currentHumidity%27%3A{{states.sensor.outside_humidity.state
          | int}}%2C%27windSpeed%27%3A0%2C%27windDirection%27%3A0%2C%27forecasts%27%3A%5B%5D%7D:String.urlencoded
        intent_action: nodomain.freeyourgadget.gadgetbridge.ACTION_GENERIC_WEATHER