<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged netatmo</title>
<link>https://coderlegion.com/tag/netatmo</link>
<description>Powered by Question2Answer</description>
<item>
<title>Getting a single value from a device's state in Home Assistant</title>
<link>https://coderlegion.com/3125/getting-a-single-value-from-a-devices-state-in-home-assistant</link>
<description>&lt;p&gt;I recently acquired &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.netatmo.com/en-eu/additional-smart-radiator-valve&quot;&gt;Netatmo smart radiator valves&lt;/a&gt; to manage my rooms' temperature remotely. I'm not skilled at manual tasks, but I could easily replace the old thermo-static valves. I then registered the smart ones in the Netatmo app. Finally, I integrated them in my Home Assistant via the dedicated &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.home-assistant.io/integrations/netatmo/&quot;&gt;Netatmo integration&lt;/a&gt;. Everything was very straightforward.&lt;/p&gt;
&lt;p&gt;I noticed that each valve not only allows remote control but also offers a state with several attributes. I wanted to extract the room's temperature indicator from it. It was not as easy as I thought it was, so I want to describe how I managed to achieve it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/1/&quot;&gt;Why Home Assistant?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/2/&quot;&gt;The Home Assistant model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/3/&quot;&gt;Replace Philips Hue automation with Home Assistant’s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/4/&quot;&gt;An example of HACS: Adaptive Lighting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/5/&quot;&gt;The Home Assistant companion app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/6/&quot;&gt;Cloudflare Tunnel for Home Assistant&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default, the Netatmo valve displays a multi-valued state. To check, go to the Developer Tools &amp;gt; States menu. You can use a filter to find the device.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Entity &lt;/th&gt;&lt;th&gt;State &lt;/th&gt;&lt;th&gt;Attributes&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;climate.spare_bedroom +&lt;br&gt;Valve Spare Bedroom &lt;/td&gt;&lt;td&gt;auto &lt;/td&gt;&lt;td&gt;hvac_modes: auto, heat +&lt;br&gt;min_temp: 7 +&lt;br&gt;max_temp: 30 +&lt;br&gt;target_temp_step: 0.5 +&lt;br&gt;preset_modes: away, boost, frost_guard, schedule +&lt;br&gt;current_temperature: 14 +&lt;br&gt;temperature: 7 +&lt;br&gt;hvac_action: idle +&lt;br&gt;preset_mode: frost_guard +&lt;br&gt;selected_schedule: Unknown 67ab635c2dd1afb1e601a8c2 +&lt;br&gt;heating_power_request: 0 +&lt;br&gt;attribution: Data provided by Netatmo +&lt;br&gt;friendly_name: Valve Spare Bedroom +&lt;br&gt;supported_features: 401&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The problem is that the above attributes are not readily usable. We must first extract them individually. For this, we need to create a &lt;em&gt;sensor&lt;/em&gt;; head to File Editor and select &lt;code&gt;configuration.yaml&lt;/code&gt;. Then, append the following snippet:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;template:
  - sensor:
    - unique_id: sensor.spare_bedroom_temperature
      name: &quot;Spare Bedroom Temperature&quot;
      state: &quot;{{ state_attr('climate.spare_bedroom', 'current_temperature') }}&quot; #1
      unit_of_measurement: &quot;°C&quot;
      device_class: temperature                                                 #2
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Match the pair entity-attribute above&lt;/li&gt;
&lt;li&gt;Must be &lt;code&gt;temperature&lt;/code&gt; to be used as a temperature sensor afterward&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Click on Save.&lt;/p&gt;
&lt;p&gt;We don't need to restart Home Assistant, but we must reload the configuration. Click on Developer Tools. Then, click on Check configuration. The new sensor should appear in Settings &amp;gt; Entities.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=11469332674979970771&quot; alt=&quot;Home Assistant displaying the new temperature entity&quot;&gt;&lt;/p&gt;
&lt;p&gt;We can now set the Area via the UI to one of the existing areas, in this case, the Spare Bedroom.&lt;/p&gt;
&lt;p&gt;Finally, we can update the Spare Bedroom area in Settings &amp;gt; Area &amp;gt; Spare Bedroom. Set the temperature sensor to the only available item, the sensor we set in the previous steps.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=6883075645107495641&quot; alt=&quot;Choose the area's newly-defined temperature sensor&quot;&gt;&lt;/p&gt;
&lt;p&gt;At this point, whenever we add the Area card to a dashboard, Home Assistant displays our newly-created temperature sensor on top of it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=24786768765211516&quot; alt=&quot;Area displaying its temperature&quot;&gt;&lt;/p&gt;
&lt;p&gt;You can use this approach for every State. Check them, and I'm sure you'll get new ideas. For example, every automation has a &lt;code&gt;last_triggered&lt;/code&gt; timestamp attribute.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To go further:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.netatmo.com/en-eu/&quot;&gt;Netatmo site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.home-assistant.io/integrations/netatmo/&quot;&gt;Netatmo integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://developers.home-assistant.io/docs/core/entity/sensor/&quot;&gt;Sensor entity&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Originally published at &lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.frankel.ch/home-assistant/7/&quot;&gt;A Java Geek&lt;/a&gt; on May 18&lt;sup&gt;th&lt;/sup&gt;, 2025&lt;/em&gt;&lt;/p&gt;
</description>
<category>Java</category>
<guid isPermaLink="true">https://coderlegion.com/3125/getting-a-single-value-from-a-devices-state-in-home-assistant</guid>
<pubDate>Thu, 22 May 2025 06:21:05 +0000</pubDate>
</item>
</channel>
</rss>