import{_ as r,c as d,a as t,d as n,b as o,e as i,w as c,r as s,o as h}from"./app-BaqUpA_K.js";const u={},p={id:"entity",tabindex:"-1"},g={class:"header-anchor",href:"#entity"};function f(m,e){const a=s("Badge"),l=s("RouteLink");return h(),d("div",null,[e[2]||(e[2]=t("h1",{id:"events-state",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#events-state"},[t("span",null,"Events: state")])],-1)),e[3]||(e[3]=t("p",null,"The Events: State node listens for state changes of entities within Home Assistant. It triggers a flow in Node-RED whenever an entity's state changes, allowing you to automate responses to various conditions, like turning on lights when motion is detected or sending a notification when a door is opened.",-1)),e[4]||(e[4]=t("h2",{id:"configuration",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#configuration"},[t("span",null,"Configuration:")])],-1)),t("h3",p,[t("a",g,[t("span",null,[e[0]||(e[0]=n("Entity ")),o(a,{text:"required"})])])]),e[5]||(e[5]=i('<ul><li>Type: <code>string</code></li></ul><p>The entity ID is used to listen for state changes. This can be a entity ID, regex, or a substring. If a regex or substring is used, the node will listen for all entities that match.</p><p>Example:</p><ul><li><code>light.kitchen</code> (entity) listens for state changes of the <code>light.kitchen</code> entity</li><li><code>^light.*</code> (regex) listens for state changes of all entities that start with <code>light.</code></li><li><code>light</code> (substring) listens for state changes of all entities that contain <code>light</code> in the entity ID</li></ul><h3 id="if-state" tabindex="-1"><a class="header-anchor" href="#if-state"><span>If State</span></a></h3><ul><li>Type: <code>string</code></li></ul><p>If the conditional is evaluated as true send the message to the first output otherwise send it to the second output. If blank there will only be one output.</p><p><strong>Also see:</strong></p>',8)),t("ul",null,[t("li",null,[o(l,{to:"/guide/conditionals.html"},{default:c(()=>e[1]||(e[1]=[n("Conditionals")])),_:1})])]),e[6]||(e[6]=i('<h3 id="for" tabindex="-1"><a class="header-anchor" href="#for"><span>For</span></a></h3><ul><li>Type: <code>number</code></li></ul><p>An amount of time an entity&#39;s state needs to be in that state before triggering.</p><div class="hint-container warning"><p class="hint-container-title">Warning</p><p>Output on Connect state changes will not start a timer.</p></div><h3 id="state-type" tabindex="-1"><a class="header-anchor" href="#state-type"><span>State Type</span></a></h3><ul><li>Type: <code>string</code></li><li>Values: <code>string|number|boolean</code></li><li>Default: <code>string</code></li></ul><p>Convert the state of the entity to the selected type. Boolean will be converted to true based on if the string is equal by default to (<code>y|yes|true|on|home|open</code>). Original value stored in msg.data.original_state</p><h3 id="ignore-state-change-event" tabindex="-1"><a class="header-anchor" href="#ignore-state-change-event"><span>Ignore state change event</span></a></h3><ul><li>Type: <code>boolean</code></li></ul><p>A list of possible states that will be ignored.</p><h3 id="output-on-connect" tabindex="-1"><a class="header-anchor" href="#output-on-connect"><span>Output on Connect</span></a></h3><ul><li>Type: <code>boolean</code></li></ul><p>Output once on startup/deploy</p><h3 id="expose-to-home-assistant" tabindex="-1"><a class="header-anchor" href="#expose-to-home-assistant"><span>Expose to Home Assistant</span></a></h3><ul><li>Type: <code>boolean</code></li></ul><p>Creates a switch within Home Assistant to enable/disable this node. This feature requires <a href="https://github.com/zachowj/hass-node-red" target="_blank" rel="noopener noreferrer">Node-RED custom integration</a> to be installed in Home Assistant</p><h2 id="outputs" tabindex="-1"><a class="header-anchor" href="#outputs"><span>Outputs</span></a></h2><p>Value types:</p><ul><li><code>event data</code>: full event object</li><li><code>entity id</code>: entity id of the triggered entity</li><li><code>entity state</code>: entity state of the triggered entity</li><li><code>config</code>: config properties of the node</li></ul>',19))])}const b=r(u,[["render",f],["__file","events-state.html.vue"]]),v=JSON.parse('{"path":"/node/events-state.html","title":"Events: state","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Configuration:","slug":"configuration","link":"#configuration","children":[{"level":3,"title":"Entity","slug":"entity","link":"#entity","children":[]},{"level":3,"title":"If State","slug":"if-state","link":"#if-state","children":[]},{"level":3,"title":"For","slug":"for","link":"#for","children":[]},{"level":3,"title":"State Type","slug":"state-type","link":"#state-type","children":[]},{"level":3,"title":"Ignore state change event","slug":"ignore-state-change-event","link":"#ignore-state-change-event","children":[]},{"level":3,"title":"Output on Connect","slug":"output-on-connect","link":"#output-on-connect","children":[]},{"level":3,"title":"Expose to Home Assistant","slug":"expose-to-home-assistant","link":"#expose-to-home-assistant","children":[]}]},{"level":2,"title":"Outputs","slug":"outputs","link":"#outputs","children":[]}],"git":{"updatedTime":1723606857000,"contributors":[{"name":"Jason","email":"37859597+zachowj@users.noreply.github.com","commits":10}]},"filePathRelative":"node/events-state.md"}');export{b as comp,v as data};
