<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108637/zigbee-battery-voltage-reporting</link><description>Hi, I have a few questions about reporting battery voltage as specified in the genPowerCfg Zigbee Cluster Library spec. I modified the zigbee light switch example to include the genPowerCfg cluster. I&amp;#39;m using an nRF52840 DK NRF52840 dev board and the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Mar 2024 23:05:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108637/zigbee-battery-voltage-reporting" /><item><title>RE: Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/thread/475782?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2024 23:05:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa575fd8-16f5-4796-b506-38eb07c211ab</guid><dc:creator>bikerglen</dc:creator><description>&lt;p&gt;It&amp;#39;s a bit of kluge and likely not compliant with the Zigbee spec (technically the battery voltage is not a reportable attribute) but I was able to read the battery voltage and generate an attribute report every eight hours containing it. The complete source code is in my Github repository for the project. Two separate boards and software for them are in the main repo link.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/bikerglen/homebrew_zigbee_devices"&gt;github.com/.../homebrew_zigbee_devices&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;nrf52840-four-input/zigbee_switch_v2 is the first software build for the first board and&lt;br /&gt;nrf52840-contact/zigbee_contact_v1 is the second software build for the second board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/thread/470925?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 07:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28f77326-16e9-415d-9f0c-a11051a5f268</guid><dc:creator>bikerglen</dc:creator><description>&lt;p&gt;Hi, &lt;a title="Marte Myrvold" href="https://devzone.nordicsemi.com/members/marte.m"&gt; &lt;/a&gt;Marte. Thanks for the clarification on the way those fields work! I&amp;#39;m working through an interrupt issue at the moment then hope to post the code on github later in the week or this weekend. Once the code is there, I&amp;#39;ll mark my reply with the link to the code as the correct answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/thread/470787?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 14:36:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:535d5616-1fe9-474c-8fb9-4c40f3f626ea</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Great to hear that you managed to figure it out!&lt;/p&gt;
&lt;p&gt;You are correct that you need to set the reporting intervals. If the maximum reporting interval is set to 0xffff then the device shall not issue any reports for the attribute. If it is set to 0x0000 and minimum reporting interval is set to something other than 0xffff then the device shall not do periodic reporting. It can still send reports on value change in the last case, but not periodic.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/thread/470594?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 03:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d27123f-00b7-40f4-a936-344c4b296a87</guid><dc:creator>bikerglen</dc:creator><description>&lt;p&gt;I may have figured it out. I initialized most of the fields in the reporting info struct. Setting the default min interval and default max interval fields seems to have done the trick. I&amp;#39;m getting battery voltage attribute reports every 10 to 30 seconds or so. Now to move these from the dev board and sandbox project to my real hardware and real project.&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;    batt_rep_info.direction = ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT;
    batt_rep_info.ep = LIGHT_SWITCH_ENDPOINT;
    batt_rep_info.cluster_id = ZB_ZCL_CLUSTER_ID_POWER_CONFIG;
    batt_rep_info.cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE;
    batt_rep_info.attr_id = ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID;
    batt_rep_info.dst.short_addr = 0x0000;
    batt_rep_info.dst.endpoint = 1;
    batt_rep_info.dst.profile_id = ZB_AF_HA_PROFILE_ID;
    batt_rep_info.u.send_info.min_interval = 3;       // 3 seconds
    batt_rep_info.u.send_info.max_interval = 15;     // 15 seconds
    batt_rep_info.u.send_info.delta.u8 = 0x00;         // x 100 mV
    batt_rep_info.u.send_info.reported_value.u8 = 0xFF;
    batt_rep_info.u.send_info.def_min_interval = 10;
    batt_rep_info.u.send_info.def_max_interval = 30;&lt;/pre&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/thread/470593?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 02:52:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20099ea2-82c6-4d37-955e-13d9c3cd7e7d</guid><dc:creator>bikerglen</dc:creator><description>&lt;p&gt;I don&amp;#39;t have any idea if this is compliant with the zigbee spec or is how the API is supposed to be used, but it lets me send an attribute report after a button press:&lt;/p&gt;
&lt;p&gt;During initialization, I run the following the code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    zb_ret_t status;
    
    zb_zcl_reporting_info_t batt_rep_info;
    memset(&amp;amp;batt_rep_info, 0, sizeof(batt_rep_info));
    
    batt_rep_info.direction = ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT;
    batt_rep_info.ep = LIGHT_SWITCH_ENDPOINT;
    batt_rep_info.cluster_id = ZB_ZCL_CLUSTER_ID_POWER_CONFIG;
    batt_rep_info.cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE;
    batt_rep_info.attr_id = ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID;
    batt_rep_info.dst.profile_id = ZB_AF_HA_PROFILE_ID;
    batt_rep_info.u.send_info.min_interval = 3;       // 3 seconds
    batt_rep_info.u.send_info.max_interval = 15;     // 15 seconds
    batt_rep_info.u.send_info.delta.u8 = 0x00;         // x 100 mV
        
    status = zb_zcl_put_reporting_info(&amp;amp;batt_rep_info, ZB_TRUE);       

    status = zb_zcl_start_attr_reporting(
            LIGHT_SWITCH_ENDPOINT,
            ZB_ZCL_CLUSTER_ID_POWER_CONFIG,  
            ZB_ZCL_CLUSTER_SERVER_ROLE,  
            ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then after a button press, I run the following code:&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;    zb_zcl_set_attr_val(LIGHT_SWITCH_ENDPOINT,
                                     ZB_ZCL_CLUSTER_ID_POWER_CONFIG, 
                                     ZB_ZCL_CLUSTER_SERVER_ROLE, 
                                     ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID,
                                     &amp;amp;battery_voltage, 
                                     ZB_FALSE);
    zb_zcl_mark_attr_for_reporting (
           LIGHT_SWITCH_ENDPOINT,
           ZB_ZCL_CLUSTER_ID_POWER_CONFIG,
           ZB_ZCL_CLUSTER_SERVER_ROLE,
           ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This gets me an attribute report after the button press containing the battery voltage but no periodic reports.&lt;/p&gt;
&lt;p&gt;What do I need to kick off the report timers?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Battery Voltage Reporting</title><link>https://devzone.nordicsemi.com/thread/470579?ContentTypeID=1</link><pubDate>Sun, 25 Feb 2024 23:11:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:716a7306-1d39-4d1b-87d6-91c4ea80b51c</guid><dc:creator>bikerglen</dc:creator><description>&lt;p&gt;Addendum: Is there a function I can call that will send an attribute report? This might be the path of least resistance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>