DIY मीडिया होम लोगो

अपनी खुद की होम थिएटर और हाय-Fi सेटअप डिजाइन और बनाने के लिए परम साइट.

2गृह सहायक में वायु गुणवत्ता

I recently wrote about how to show bin col­lec­tion inform­a­tion in Home Assist­ant, and my next pro­ject was to pull some air qual­ity inform­a­tion. For­tu­nately I have a ‘Tado’ account which meant I could pull this inform­a­tion from their एपीआई using the fol­low­ing code

अपडेट किया गया 20-दिसंबर-2021

This was updated to tweak an issue where home assist­ant con­verts the text value “none” into “unknown”.

Much of the inform­a­tion for this was taken from a thread on the home assist­ant for­ums, but I was able to add pol­lu­tion as well as pol­len inform­a­tion, 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 cred­it to Drillbit on the for­ums though.

Tado खाता विवरण

  • You will need some inform­a­tion for your Tado account
  • Vis­it https://my.tado.com/api/v2/me?उपयोगकर्ता नाम @you@emailaddress.tld&पासवर्ड = yourpassword
  • Near the top of the out­put you need the numer­ic ID that is lis­ted under homes: 0: आईडी:
  • आगामी, के लिए जाओ https://www.latlong.net/ and loc­ate your home and make a note of the lat­it­ude and longitude
  • Next vis­it https://acme.tado.com/v1/homes/आपकी घर-आईडी/airComfort?अक्षांश =12.34&देशांतर =12.34&उपयोगकर्ता नाम =आपका ईमेल&पासवर्ड =your-pass­word यह सुनिश्चित करने के लिए कि यह लोड है

गृह सहायक के लिए कोड

  • Add the fol­low­ing 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["आउटडोर की गुणवत्ता"]["पराग"]["प्रमुख"]["स्तर"]') == 'अज्ञात' %}
               कोई नहीं.
             {% अन्य %}
               {{राज्यों('sensor.tadoair.attributes["आउटडोर की गुणवत्ता"]["पराग"]["प्रमुख"]["स्तर"]')}}
             {% अगर अंत %}
           परिचित नाम: "पराग स्तर"
           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: "प्रदूषण_ नत्रजन"
    

उत्तर छोड़ दें

2 टिप्पणियाँ

एफflavio

CIao
stavo seguendo la tua guida. Ti risulta che la stringa di tado fun­zioni ancora? per­chè mi restituisce errore {“message”:“User is not author­ized to access this resource with an expli­cit deny”} oppure ins­er­en­dola in ver­sione codice yaml mi restituisce {“message”:“Token di autenticazione man­cante”} . Grazie

जवाब दें
जेएसजॉन Scaife

Hi Fla­vio

हां, this is still work­ing for me.
मेरे यूआरएल है https://acme.tado.com/v1/homes/123456/airComfort?latitude=11.11&longitude=11.11&username=me@myemail.com&password=mypassword

Obvi­ously I’ve removed the home ID, lat­it­ude, lon­git­ude, email address, and pass­word I use. But if you get those right then it should load fine

Have you double checked your email address and pass­word? Have you checked your home ID at https://my.tado.com/api/v2/me?username=you@emailaddress.tld&password=yourpassword

I don’t know if the Tado sys­tem is dif­fer­ent out­side of the यूके — maybe they don’t have data for lat­it­ude and lon­git­ude where you are? Do you get air qual­ity data in your Tado app when you’re logged into your account?

जवाब दें