Home Assistant Integration to get current weather information directly from Data.gov.sg weather API published by Singapore National Environment Agency (SG NEA)
Add this integration to Home Assistant using HACS, or copy everything in custom_components/nea_sg_weather to your custom_components folder in your Home Assistant config folder.
Follow the integration config flow to set up the following entities:
weather: weather entity with 4 day forecastsarea(town) sensors: current weather conditions for up to 47 areas/towns in Singaporeregionsensors: 24 hour weather condition forecast for North/South/East/West/Central regions of Singaporeraincamera: 2 camera entities for static and animated rain map overlays updated every 5 minutes from NEArainsensors: one rainfall sensor per active NEA station, fetched live from the API — stations are added and removed automatically as the API changespm25sensors: 5 pm2.5 sensors for North/South/East/West/Central regions of Singaporepsisensors: 5 sensors with the 24-hour PSI for North/South/East/West/Central regions of Singapore; the 24-hour PM2.5 and the per-pollutant sub-indices are exposed as attributesuv_indexsensor: UV index for Singapore
Several yaml files are included to help you quickly set up a weather map card on Lovelace UI.
For the overlays to display properly, you will need the area, region and rain entities activated in the config flow.
input_boolean.yaml: to set upinput_booleantoggles for the map overlaysautomations.yaml: automations to manage how the map toggles worklovelace.yaml: preset card config to display the weather map card
Instructions for how to integrate the yaml files are included in the various files in the nea_sg_weather/yaml folder.
Rainfall sensors are created dynamically from the live NEA API — no static station list is used. Orphaned sensors (stations decommissioned by NEA) are automatically removed from Home Assistant on startup and whenever the station list changes at runtime.
Sensors include location attributes so they can be displayed on a Lovelace map card.
For entity pictures to display correctly, copy all image files in www/weather/ to your config/www/weather/ folder.