I recently wrote about how to show bin collection information in Home Assistant, and my next project was to pull some air quality information. Fortunately I have a ‘Tado’ account which meant I could pull this information from their एपीआई using the following code
Much of the information for this was taken from a thread on the home assistant forums, but I was able to add pollution as well as pollen information, and I also had to tweak the code to resolve an issue with “none” being treated as “unknown” rather than as a string of text. Lots of credit to Drillbit on the forums though.
Tado खाता विवरण
- You will need some information for your Tado account
- Visit https://my.tado.com/api/v2/me?उपयोगकर्ता नाम @you@emailaddress.tld&पासवर्ड = yourpassword
- Near the top of the output you need the numeric ID that is listed under homes: 0: आईडी:
- आगामी, के लिए जाओ https://www.latlong.net/ and locate your home and make a note of the latitude and longitude
- Next visit https://acme.tado.com/v1/homes/आपकी घर-आईडी/airComfort?अक्षांश =12.34&देशांतर =12.34&उपयोगकर्ता नाम =आपका ईमेल&पासवर्ड =your-password यह सुनिश्चित करने के लिए कि यह लोड है
गृह सहायक के लिए कोड
- Add the following code to your configuration.yaml
सेंसर: - मंच: आराम # एपीआई हवा की गुणवत्ता प्राप्त करने के लिए कॉल करें # Result goes into outdoorQuality attribute in JSON format name: TadoAir verify_ssl: true scan_interval: 1800 संसाधन: hTTPS://acme.tado.com/v1/homes/आपकी घर-आईडी/airComfort?अक्षांश =12.34&देशांतर =12.34&उपयोगकर्ता नाम =आपका ईमेल&पासवर्ड =आपका पासवर्ड हेडर: उपभोक्ता अभिकर्ता: Home Assistant Content-Type: application/json method: GET json_attributes: - roomMessages - outdoorQuality value_template: 'ताड़ो हवा आराम' # विभिन्न टेम्पलेट सेंसरों को आबाद करने के लिए JSON की गणना करें - मंच: template sensors: हवा की गुणवत्ता: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["यहां"]["स्तर"] | मूल बनाना }}' friendly_name: "हवा की गुणवत्ता" icon_template: एमडीआई:air-filter unique_id: "हवा की गुणवत्ता" # Pollen sensors air_pollen_level: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रमुख"]["स्तर"] | मूल बनाना }}' friendly_name: "पराग स्तर" icon_template: एमडीआई:flower unique_id: "परागकण_लेवल" air_pollen_level_grass: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रकार"][0]["इस तरह का अनुभव"][0]["स्तर"] | मूल बनाना }}.' friendly_name: "घास का पराग" icon_template: एमडीआई:flower unique_id: "घास_पॉलन_लेवल" air_pollen_level_grass_tomorrow: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रकार"][0]["इस तरह का अनुभव"][1]["स्तर"] | मूल बनाना }}.' friendly_name: "घास पराग तोमो।" icon_template: एमडीआई:flower unique_id: "घास_पॉलन_लेवल_टोमर" air_pollen_level_weed: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रकार"][1]["इस तरह का अनुभव"][0]["स्तर"] | मूल बनाना }}.' friendly_name: "पौधा पराग" icon_template: एमडीआई:sprout unique_id: "plant_pollen_level" air_pollen_level_weed_tomorrow: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रकार"][1]["इस तरह का अनुभव"][1]["स्तर"] | मूल बनाना }}.' friendly_name: "पौधे पराग तोमो।" icon_template: एमडीआई:sprout unique_id: "plant_pollen_level_tomorrow" air_pollen_level_tree: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रकार"][2]["इस तरह का अनुभव"][0]["स्तर"] | मूल बनाना }}.' friendly_name: "पेड़ पराग " icon_template: एमडीआई:tree unique_id: "tree_pollen_level" air_pollen_level_tree_tomorrow: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रकार"][2]["इस तरह का अनुभव"][1]["स्तर"] | मूल बनाना }}.' friendly_name: "पेड़ पराग तोमो।" icon_template: एमडीआई:tree unique_id: "tree_pollen_level_tomorrow" air_pollution_level_pm10: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][0]["स्तर"] | मूल बनाना }}: {{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][0]["एकाग्रता"]["मूल्य"]}}μg/m³' friendly_name: "बजे 10" icon_template: एमडीआई:tree unique_id: "प्रदूषण_ pm10" air_pollution_level_pm25: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][1]["स्तर"] | मूल बनाना }}: {{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][1]["एकाग्रता"]["मूल्य"]}}μg/m³' friendly_name: "बजे 2.5" icon_template: एमडीआई:tree unique_id: "प्रदूषण_ pm25" air_pollution_level_ozone: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][2]["स्तर"] | मूल बनाना }}: {{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][2]["एकाग्रता"]["मूल्य"]}}ppb' friendly_name: "ओजोन" icon_template: एमडीआई:tree unique_id: "प्रदूषण_जून" air_pollution_level_sulphur: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][3]["स्तर"] | मूल बनाना }}: {{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][3]["एकाग्रता"]["मूल्य"]}}ppb' friendly_name: "सल्फर डाइऑक्साइड" icon_template: एमडीआई:tree unique_id: "प्रदूषण_ सल्फ" air_pollution_level_carbon: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][4]["स्तर"] | मूल बनाना }}: {{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][4]["एकाग्रता"]["मूल्य"]}}ppb' friendly_name: "कार्बन मोनोऑक्साइड" icon_template: एमडीआई:tree unique_id: "प्रदूषण_कारण" air_pollution_level_nitrogen: value_template: '{{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][5]["स्तर"] | मूल बनाना }}: {{ राज्यों। sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["प्रदूषण"][5]["एकाग्रता"]["मूल्य"]}}ppb' friendly_name: "नाइट्रोजन डाइऑक्साइड" icon_template: एमडीआई:tree unique_id: "प्रदूषण_ नत्रजन"
तुम क्या सोचते हो? हमें एक टिप्पणी के नीचे छोड़! आप सदस्यता के लिए चाहते हैं, तो ऊपर दाईं ओर मेनू पर लिंक का उपयोग करें सदस्यता लें. आप नीचे दिए गए सामाजिक लिंक का उपयोग करके अपने दोस्तों के साथ इस साझा कर सकते हैं. चियर्स.
उत्तर छोड़ दें