<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Trying to automate in Domoticz]]></title><description><![CDATA[<p dir="auto">Hello everyone, I just started with mysensors, I have successfully connected a serial gateway and a node that measures temperature. I'm now trying to automate on domoticz so that I can get notifications and other things of my node. I am trying to learn dzVents in the domoticz wiki:(<a href="https://www.domoticz.com/wiki/DzVents:_next_generation_Lua_scripting" rel="nofollow ugc">https://www.domoticz.com/wiki/DzVents:_next_generation_Lua_scripting</a>)<br />
The problem is that When I save and run the Quickstart code with the name of my switch the log only shows that it has been turn on and doesnt show my log message.<br />
return {<br />
on = {<br />
devices = {<br />
'switch'<br />
}<br />
},<br />
execute = function(domoticz, switch)<br />
if (switch.state == 'On') then<br />
domoticz.log('Hey! I am on!')<br />
else<br />
domoticz.log('Hey! I am off!')<br />
end<br />
end<br />
}<br />
}</p>
<p dir="auto">I have already set the local network to 127.0.0.1 and enabled dzVents.<br />
Does anyone now what is happening?</p>
]]></description><link>https://forum.mysensors.org/topic/11911/trying-to-automate-in-domoticz</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 16:32:56 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/11911.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Feb 2022 23:13:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Trying to automate in Domoticz on Mon, 28 Feb 2022 03:39:37 GMT]]></title><description><![CDATA[<p dir="auto">the problem is "if (switch.state == 'On') then" that not works, write:</p>
<pre><code>if (switch.active) then
</code></pre>
<p dir="auto">or</p>
<pre><code>if (switch.inActive) then
</code></pre>
<p dir="auto"><a href="https://www.domoticz.com/wiki/DzVents:_next_generation_Lua_scripting#:~:text=have%20that%20information.-,Device%20attributes%20and%20methods%20for%20all%20devices,-active%3A%20Boolean.%20Is" rel="nofollow ugc">Device attributes and methods for all devices</a></p>
]]></description><link>https://forum.mysensors.org/post/111654</link><guid isPermaLink="true">https://forum.mysensors.org/post/111654</guid><dc:creator><![CDATA[MHofer]]></dc:creator><pubDate>Mon, 28 Feb 2022 03:39:37 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to automate in Domoticz on Sat, 26 Feb 2022 19:22:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/boum" aria-label="Profile: boum">@<bdi>boum</bdi></a> sadly it didnt work :( I made sure that the name of the switch was well written and I added a domoticz.log with a message inside the function and it didnt work.</p>
]]></description><link>https://forum.mysensors.org/post/111637</link><guid isPermaLink="true">https://forum.mysensors.org/post/111637</guid><dc:creator><![CDATA[Feliw05]]></dc:creator><pubDate>Sat, 26 Feb 2022 19:22:35 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to automate in Domoticz on Sat, 26 Feb 2022 14:04:40 GMT]]></title><description><![CDATA[<p dir="auto">First, make sure your switch is really named 'switch', the scripts are case sensitive, so neither 'Switch' nor 'SWITCH' will work. Also, verify you don't have a trailing space in the name ('switch ').<br />
To check your script is run when the device is changed, add a <em>domoticz.log</em> first line in the execute function.<br />
Hope this helps.</p>
]]></description><link>https://forum.mysensors.org/post/111635</link><guid isPermaLink="true">https://forum.mysensors.org/post/111635</guid><dc:creator><![CDATA[boum]]></dc:creator><pubDate>Sat, 26 Feb 2022 14:04:40 GMT</pubDate></item></channel></rss>