dzvents rgb broadlink

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

dzvents rgb broadlink

Post by pvklink »

Hi,

I just get my lidl (livarnolux color outdoor) led lamp working with broadlink in domoticz.
But now i have the following 7 devices to manage this lamp.
Is there a way to get as much as possible functions in less devices with dzvents?

these are the 7 devices i made
1. On
2. Off
3. toggle colors
4. white
5. dim
6. flame option
7. speed of the flame changes
8. play/pause (different colors)

I know i can make these devices invisble with $.
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

pvklink wrote: Sunday 05 May 2019 20:36 I just get my lidl (livarnolux color outdoor) led lamp working with broadlink in domoticz.
But now i have 7 devices to manage this lamp.
Is there a way to get as much as possible functions in less devices with dzVents?
Maybe by creating a virtual selector switch and use this dzVents script.

Code: Select all

return {
            on =    {   devices =    { "Lidl" }},   -- controller , define as virtual selector Switch with all level as named in action table 
                   
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local Lidl = dz.devices("livarnolux")

        local function other()  -- you can define whatever actions you need in these functions.
            dz.devices('device1').toggleSwitch().silent().afterSec(4)
        end
        
        local function dimTo(level)
            Lidl.dimTo(level) 
        end
        
        actions = { Off      = function() Lidl.switchOff() return end,
                    On       = function() Lidl.switchOn() return end,
                    dimTo30  = function() dimTo(30) return end, 
                    speed    = function() other() return end,
                    dimTo70  = function() dimTo(70) return end, }
        
        actions[item.levelName]() -- Call required function with key = levelName 
    end
}   
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

irrigation works wonderful!

I made a virtual selector "usb lamp" as you mentioned with all the functions as decribed (see attachment)
for the time being i filled the action part with http commands that activates the different (hidden $) switches that give a rf signal to my lidl lamp.
this works for a part...
for example: activate "flame" only works when the lamp is on, so i have to execute two switches for this.

So i need dzvents to solve this and take over the action part, can you give an example for one function, i dont see the match between the action part and the dzvents script...
Attachments
lidl.png
lidl.png (83.31 KiB) Viewed 1154 times
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

pvklink wrote: Monday 06 May 2019 19:00 So i need dzvents to solve this and take over the action part, can you give an example for one function, i dont see the match between the action part and the dzvents script...
Is the IP number in the action part your domoticz system ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

Yes, and the devices are (hidden) broadlink switches which send the different rf signals(on for each switch) that i grap from the air with the broadlink plugin

On puts the light on
Off puts it off
Play let the light play different colorscheme's and toggle it pauses it
flame let the light go flikkering like a candle
white turns it back to normal white without flickering
dim dims the device when you toggle it and after the lowest value it start alover again for hight to low (four stages)
Speed is the flicker speed (toggle between two stages quick and slow)
Color toggles between four colors
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

Can you try this ? (after disabling the actions in the selector devices)

Code: Select all

return {
            on =    {   devices =    { "usb lamp" }},   -- controller , define as virtual selector Switch with all level as named in action table 
                   
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Wit    = dz.devices(1327)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)

        local function other()  -- you can define whatever actions you need in these functions.
            dz.devices('device1').toggleSwitch().silent().afterSec(4)
        end
        
        local function dimTo(level)
            Lidl.dimTo(level) 
        end
        
        actions = { Off       = function() triggerDevice_Off.switchOn() return end,
                    Aan       = function() triggerDevice_Aan.switchOn() return end,
                    Kleur     = function() triggerDevice_Aan.switchOn().checkFirst() triggerDevice_Kleur.switchOn() return end, 
                    Wit       = function() triggerDevice_Aan.switchOn().checkFirst() triggerDevice_Wit.switchOn() return end,
                    Flame     = function() triggerDevice_Aan.switchOn().checkFirst() triggerDevice_Flame.switchOn() return end, 
                    Play      = function() triggerDevice_Aan.switchOn().checkFirst() triggerDevice_Play.switchOn() return end, 
                    Dim       = function() triggerDevice_Aan.switchOn().checkFirst() triggerDevice_Dim.switchOn() return end, 
                    Speed     = function() triggerDevice_Aan.switchOn().checkFirst() triggerDevice_Speed.switchOn() return end, }
        
        actions[item.levelName]() -- Call required function with key = levelName 
    end
}   
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

i will!
thirst go to work....
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

domoticz does not start anymore
crashlog

Code: Select all

[New LWP 756]
[New LWP 762]
[New LWP 768]
[New LWP 769]
[New LWP 770]
[New LWP 771]
[New LWP 772]
[New LWP 773]
[New LWP 774]
[New LWP 775]
[New LWP 776]
[New LWP 777]
[New LWP 858]
[New LWP 859]
[New LWP 860]
[New LWP 861]
[New LWP 862]
[New LWP 863]
[New LWP 864]
[New LWP 865]
[New LWP 866]
[New LWP 867]
[New LWP 872]
[New LWP 873]
[New LWP 874]
[New LWP 909]
[New LWP 996]
[New LWP 1384]
[New LWP 1833]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
0x76e7ed60 in nanosleep () at ../sysdeps/unix/syscall-template.S:84
84	../sysdeps/unix/syscall-template.S: Bestand of map bestaat niet.
  Id   Target Id         Frame 
* 1    Thread 0x76f56e30 (LWP 755) "domoticz" 0x76e7ed60 in nanosleep () at ../sysdeps/unix/syscall-template.S:84
  2    Thread 0x75f4b430 (LWP 756) "Watchdog" 0x76e7f51c in __waitpid (pid=1825, stat_loc=0x75f4a5a0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
  3    Thread 0x7574a430 (LWP 762) "SQLHelper" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  4    Thread 0x74f49430 (LWP 768) "PluginMgr" 0x76e7a9a4 in __pthread_cond_wait (cond=0xb9c178 <m_mainworker+480>, mutex=0xb9c160 <m_mainworker+456>) at pthread_cond_wait.c:188
  5    Thread 0x744c6430 (LWP 769) "InfluxPush" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  6    Thread 0x73cc5430 (LWP 770) "Webem_ssncleane" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
  7    Thread 0x734c4430 (LWP 771) "WebServer_82" 0x76e7ad3c in __pthread_cond_timedwait (cond=0x72b06500, mutex=0x72b064e8, abstime=0x734be778) at pthread_cond_timedwait.c:200
  8    Thread 0x72aff430 (LWP 772) "Webem_ssncleane" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
  9    Thread 0x722fe430 (LWP 773) "WebServer_443" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
  10   Thread 0x718ff430 (LWP 774) "Scheduler" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  11   Thread 0x710fe430 (LWP 775) "TCPServer" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
  12   Thread 0x708fd430 (LWP 776) "MainWorker" 0x76e7df10 in __lll_lock_wait (futex=futex@entry=0x140d620, private=0) at lowlevellock.c:46
  13   Thread 0x700fc430 (LWP 777) "MainWorkerRxMsg" 0x76e7a9a4 in __pthread_cond_wait (cond=0xb9c178 <m_mainworker+480>, mutex=0xb9c160 <m_mainworker+456>) at pthread_cond_wait.c:188
  14   Thread 0x6f2ff430 (LWP 858) "RFXCOM" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  15   Thread 0x6eafe430 (LWP 859) "ZWaveBase" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  16   Thread 0x6e2fd430 (LWP 860) "MainWorker" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
  17   Thread 0x6dafc430 (LWP 861) "P1 Meter" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  18   Thread 0x6d0ff430 (LWP 862) "Domoticz_HBWork" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  19   Thread 0x6c8fe430 (LWP 863) "Pinger" 0x76e7a9a4 in __pthread_cond_wait (cond=0x6d102430, mutex=0x6d102418) at pthread_cond_wait.c:188
  20   Thread 0x6c0fd430 (LWP 864) "Philips Hue" 0x76e7ad3c in __pthread_cond_timedwait (cond=0x6f41bb38, mutex=0x6f41bb20, abstime=0x6c0fc980) at pthread_cond_timedwait.c:200
  21   Thread 0x6b8fc430 (LWP 865) "MQTT" 0x76cc6740 in __pselect (nfds=44, readfds=0x6b8fbca8, writefds=0x6b8fbd28, exceptfds=0x0, timeout=<optimized out>, sigmask=0x0) at ../sysdeps/unix/sysv/linux/pselect.c:69
  22   Thread 0x6b0fb430 (LWP 866) "Domoticz_HBWork" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
  23   Thread 0x6a8fa430 (LWP 867) "PluginMgr_IO" 0x76e7a9a4 in __pthread_cond_wait (cond=0x1322658, mutex=0x1322634) at pthread_cond_wait.c:188
  24   Thread 0x6a0f9430 (LWP 872) "ZWaveBase" 0x76e7ad3c in __pthread_cond_timedwait (cond=0x6f5016f8, mutex=0x6f5016e0, abstime=0x6a0f6a50) at pthread_cond_timedwait.c:200
  25   Thread 0x698f8430 (LWP 873) "ZWaveBase" 0x76cc6674 in select () at ../sysdeps/unix/syscall-template.S:84
  26   Thread 0x690f7430 (LWP 874) "ZWaveBase" 0x76e7ad3c in __pthread_cond_timedwait (cond=0x72b00548, mutex=0x72b00530, abstime=0x690f6cf8) at pthread_cond_timedwait.c:200
  27   Thread 0x688f6430 (LWP 909) "RFXCOM" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
  28   Thread 0x67529430 (LWP 996) "Plugin_Broadlin" 0x76e7df10 in __lll_lock_wait (futex=futex@entry=0xba1634 <Plugins::PythonMutex>, private=0) at lowlevellock.c:46
  29   Thread 0x652ff430 (LWP 1384) "Plugin_Chromeca" 0x76e7df40 in __lll_lock_wait (futex=futex@entry=0xba1634 <Plugins::PythonMutex>, private=0) at lowlevellock.c:43
  30   Thread 0x680f5430 (LWP 1833) "PingerWorker" 0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84

Thread 30 (Thread 0x680f5430 (LWP 1833)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x0056613c in CPinger::Do_Ping_Worker(CPinger::PingNode const&) ()
#4  0x008a3c5c in thread_proxy ()
#5  0x76e73fc4 in start_thread (arg=0x680f5430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 29 (Thread 0x652ff430 (LWP 1384)):
#0  0x76e7df40 in __lll_lock_wait (futex=futex@entry=0xba1634 <Plugins::PythonMutex>, private=0) at lowlevellock.c:43
#1  0x76e76bd4 in __GI___pthread_mutex_lock (mutex=0xba1634 <Plugins::PythonMutex>) at pthread_mutex_lock.c:80
#2  0x00609f6c in Plugins::CPlugin::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x652ff430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 28 (Thread 0x67529430 (LWP 996)):
#0  0x76e7df10 in __lll_lock_wait (futex=futex@entry=0xba1634 <Plugins::PythonMutex>, private=0) at lowlevellock.c:46
#1  0x76e76bd4 in __GI___pthread_mutex_lock (mutex=0xba1634 <Plugins::PythonMutex>) at pthread_mutex_lock.c:80
#2  0x00609f6c in Plugins::CPlugin::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x67529430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 27 (Thread 0x688f6430 (LWP 909)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x003f3eb0 in boost::asio::io_context::run() ()
#4  0x008a3c5c in thread_proxy ()
#5  0x76e73fc4 in start_thread (arg=0x688f6430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 26 (Thread 0x690f7430 (LWP 874)):
#0  0x76e7ad3c in __pthread_cond_timedwait (cond=0x72b00548, mutex=0x72b00530, abstime=0x690f6cf8) at pthread_cond_timedwait.c:200
#1  0x008605a0 in OpenZWave::EventImpl::Wait(int) ()
#2  0x0085de48 in OpenZWave::Wait::Multiple(OpenZWave::Wait**, unsigned int, int) ()
#3  0x008649d4 in OpenZWave::Driver::PollThreadProc(OpenZWave::Event*) ()
#4  0x0089ee30 in OpenZWave::ThreadImpl::Run() ()
#5  0x0089ee4c in OpenZWave::ThreadImpl::ThreadProc(void*) ()
#6  0x76e73fc4 in start_thread (arg=0x690f7430) at pthread_create.c:458
#7  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 25 (Thread 0x698f8430 (LWP 873)):
#0  0x76cc6674 in select () at ../sysdeps/unix/syscall-template.S:84
#1  0x0089f53c in OpenZWave::SerialControllerImpl::Read(OpenZWave::Event*) ()
#2  0x0089f5a0 in OpenZWave::SerialControllerImpl::ReadThreadProc(OpenZWave::Event*) ()
#3  0x0089ee30 in OpenZWave::ThreadImpl::Run() ()
#4  0x0089ee4c in OpenZWave::ThreadImpl::ThreadProc(void*) ()
#5  0x76e73fc4 in start_thread (arg=0x698f8430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 24 (Thread 0x6a0f9430 (LWP 872)):
#0  0x76e7ad3c in __pthread_cond_timedwait (cond=0x6f5016f8, mutex=0x6f5016e0, abstime=0x6a0f6a50) at pthread_cond_timedwait.c:200
#1  0x0029ffac in MainWorker::CheckAndPushRxMessage(CDomoticzHardwareBase const*, unsigned char const*, char const*, int, bool) ()
#2  0x002a06c4 in MainWorker::PushAndWaitRxMessage(CDomoticzHardwareBase const*, unsigned char const*, char const*, int) ()
#3  0x005fb40c in ZWaveBase::SendSwitchIfNotExists(ZWaveBase::_tZWaveDevice const*) ()
#4  0x005fc088 in ZWaveBase::InsertDevice(ZWaveBase::_tZWaveDevice) ()
#5  0x005249c4 in COpenZWave::AddValue(OpenZWave::ValueID const&, COpenZWave::NodeInfo const*) ()
#6  0x00531734 in COpenZWave::OnZWaveNotification(OpenZWave::Notification const*) ()
#7  0x0082b548 in OpenZWave::Manager::NotifyWatchers(OpenZWave::Notification*) ()
#8  0x008692a0 in OpenZWave::Driver::NotifyWatchers() ()
#9  0x00871cc0 in OpenZWave::Driver::DriverThreadProc(OpenZWave::Event*) ()
#10 0x0089ee30 in OpenZWave::ThreadImpl::Run() ()
#11 0x0089ee4c in OpenZWave::ThreadImpl::ThreadProc(void*) ()
#12 0x76e73fc4 in start_thread (arg=0x6a0f9430) at pthread_create.c:458
#13 0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 23 (Thread 0x6a8fa430 (LWP 867)):
#0  0x76e7a9a4 in __pthread_cond_wait (cond=0x1322658, mutex=0x1322634) at pthread_cond_wait.c:188
#1  0x003f30bc in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#2  0x003f3eb0 in boost::asio::io_context::run() ()
#3  0x008a3c5c in thread_proxy ()
#4  0x76e73fc4 in start_thread (arg=0x6a8fa430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 22 (Thread 0x6b0fb430 (LWP 866)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x00437890 in CDomoticzHardwareBase::Do_Heartbeat_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x6b0fb430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 21 (Thread 0x6b8fc430 (LWP 865)):
#0  0x76cc6740 in __pselect (nfds=44, readfds=0x6b8fbca8, writefds=0x6b8fbd28, exceptfds=0x0, timeout=<optimized out>, sigmask=0x0) at ../sysdeps/unix/sysv/linux/pselect.c:69
#1  0x008d6240 in mosquitto_loop.part ()
#2  0x004ccf40 in MQTT::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x6b8fc430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 20 (Thread 0x6c0fd430 (LWP 864)):
#0  0x76e7ad3c in __pthread_cond_timedwait (cond=0x6f41bb38, mutex=0x6f41bb20, abstime=0x6c0fc980) at pthread_cond_timedwait.c:200
#1  0x0029ffac in MainWorker::CheckAndPushRxMessage(CDomoticzHardwareBase const*, unsigned char const*, char const*, int, bool) ()
#2  0x002a06c4 in MainWorker::PushAndWaitRxMessage(CDomoticzHardwareBase const*, unsigned char const*, char const*, int) ()
#3  0x00555be8 in CPhilipsHue::InsertUpdateSwitch(int, CPhilipsHue::_eHueLightType, CPhilipsHue::_tHueLightState, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) ()
#4  0x00558614 in CPhilipsHue::GetLights(Json::Value const&) ()
#5  0x00559ebc in CPhilipsHue::GetStates() ()
#6  0x0055a14c in CPhilipsHue::Do_Work() ()
#7  0x009f18fc in execute_native_thread_routine ()
#8  0x76e73fc4 in start_thread (arg=0x6c0fd430) at pthread_create.c:458
#9  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 19 (Thread 0x6c8fe430 (LWP 863)):
#0  0x76e7a9a4 in __pthread_cond_wait (cond=0x6d102430, mutex=0x6d102418) at pthread_cond_wait.c:188
#1  0x008a7e78 in boost::condition_variable::wait(boost::unique_lock<boost::mutex>&) ()
#2  0x008a4918 in boost::thread::join_noexcept() ()
#3  0x00563598 in CPinger::DoPingHosts() ()
#4  0x00563abc in CPinger::Do_Work() ()
#5  0x009f18fc in execute_native_thread_routine ()
#6  0x76e73fc4 in start_thread (arg=0x6c8fe430) at pthread_create.c:458
#7  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 18 (Thread 0x6d0ff430 (LWP 862)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x00437890 in CDomoticzHardwareBase::Do_Heartbeat_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x6d0ff430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 17 (Thread 0x6dafc430 (LWP 861)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x005521f0 in P1MeterSerial::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x6dafc430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 16 (Thread 0x6e2fd430 (LWP 860)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x003f3eb0 in boost::asio::io_context::run() ()
#4  0x008a3c5c in thread_proxy ()
#5  0x76e73fc4 in start_thread (arg=0x6e2fd430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 15 (Thread 0x6eafe430 (LWP 859)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x005fd7fc in ZWaveBase::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x6eafe430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 14 (Thread 0x6f2ff430 (LWP 858)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x0057dccc in RFXComSerial::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x6f2ff430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 13 (Thread 0x700fc430 (LWP 777)):
#0  0x76e7a9a4 in __pthread_cond_wait (cond=0xb9c178 <m_mainworker+480>, mutex=0xb9c160 <m_mainworker+456>) at pthread_cond_wait.c:188
#1  0x00270054 in boost::unique_lock<boost::shared_mutex>::lock() ()
#2  0x00260ae0 in CEventSystem::UpdateSingleState(unsigned long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, char const*, unsigned char, unsigned char, _eSwitchType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) ()
#3  0x002611ec in CEventSystem::ProcessDevice(int, unsigned long long, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#4  0x002ee49c in CSQLHelper::UpdateValueInt(int, char const*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) ()
#5  0x002efb44 in CSQLHelper::UpdateValue(int, char const*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) ()
#6  0x0028b388 in MainWorker::decode_P1MeterPower(int, _eHardwareTypes, tRBUF const*, MainWorker::_tRxMessageProcessingResult&) ()
#7  0x002ae950 in MainWorker::ProcessRXMessage(CDomoticzHardwareBase const*, unsigned char const*, char const*, int) ()
#8  0x002af534 in MainWorker::Do_Work_On_Rx_Messages() ()
#9  0x009f18fc in execute_native_thread_routine ()
#10 0x76e73fc4 in start_thread (arg=0x700fc430) at pthread_create.c:458
#11 0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 12 (Thread 0x708fd430 (LWP 776)):
#0  0x76e7df10 in __lll_lock_wait (futex=futex@entry=0x140d620, private=0) at lowlevellock.c:46
#1  0x76e76bd4 in __GI___pthread_mutex_lock (mutex=0x140d620) at pthread_mutex_lock.c:80
#2  0x0052f8d8 in COpenZWave::GetSupportedThermostatModes[abi:cxx11](unsigned long) ()
#3  0x0038e6b0 in http::server::CWebServer::GetJSonDevices(Json::Value&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#4  0x0025443c in CEventSystem::UpdateJsonMap(CEventSystem::_tDeviceStatus&, unsigned long long) ()
#5  0x0025fa78 in CEventSystem::GetCurrentStates() ()
#6  0x00260508 in CEventSystem::StartEventSystem() ()
#7  0x002abde8 in MainWorker::Do_Work() ()
#8  0x009f18fc in execute_native_thread_routine ()
#9  0x76e73fc4 in start_thread (arg=0x708fd430) at pthread_create.c:458
#10 0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 11 (Thread 0x710fe430 (LWP 775)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x0065d698 in tcp::server::CTCPServer::Do_Work() ()
#4  0x009f18fc in execute_native_thread_routine ()
#5  0x76e73fc4 in start_thread (arg=0x710fe430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 10 (Thread 0x718ff430 (LWP 774)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x002cede0 in CScheduler::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x718ff430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 9 (Thread 0x722fe430 (LWP 773)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x00698564 in http::server::server_base::run() ()
#4  0x0031a578 in http::server::CWebServer::Do_Work() ()
#5  0x009f18fc in execute_native_thread_routine ()
#6  0x76e73fc4 in start_thread (arg=0x722fe430) at pthread_create.c:458
#7  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 8 (Thread 0x72aff430 (LWP 772)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x003f3eb0 in boost::asio::io_context::run() ()
#4  0x009f18fc in execute_native_thread_routine ()
#5  0x76e73fc4 in start_thread (arg=0x72aff430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 7 (Thread 0x734c4430 (LWP 771)):
#0  0x76e7ad3c in __pthread_cond_timedwait (cond=0x72b06500, mutex=0x72b064e8, abstime=0x734be778) at pthread_cond_timedwait.c:200
#1  0x0029ffac in MainWorker::CheckAndPushRxMessage(CDomoticzHardwareBase const*, unsigned char const*, char const*, int, bool) ()
#2  0x002a6990 in MainWorker::SwitchLightInt(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, _tColor, bool) ()
#3  0x002a7800 in MainWorker::SwitchLight(unsigned long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, _tColor, bool, int) ()
#4  0x002a7964 in MainWorker::SwitchLight(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) ()
#5  0x003785f0 in http::server::CWebServer::HandleCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, http::server::_tWebEmSession&, http::server::request const&, Json::Value&) ()
#6  0x0037e948 in http::server::CWebServer::GetJSonPage(http::server::_tWebEmSession&, http::server::request const&, http::server::reply&) ()
#7  0x00675bb8 in boost::function3<void, http::server::_tWebEmSession&, http::server::request const&, http::server::reply&>::operator()(http::server::_tWebEmSession&, http::server::request const&, http::server::reply&) const ()
#8  0x00670084 in http::server::cWebem::CheckForPageOverride(http::server::_tWebEmSession&, http::server::request&, http::server::reply&) ()
#9  0x006736f0 in http::server::cWebemRequestHandler::handle_request(http::server::request const&, http::server::reply&) ()
#10 0x00665590 in http::server::connection::handle_read(boost::system::error_code const&, unsigned int) ()
#11 0x00666094 in boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::server::connection, boost::system::error_code const&, unsigned int>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<http::server::connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> > >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned int) ()
#12 0x003f31ec in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#13 0x00698564 in http::server::server_base::run() ()
#14 0x0031a578 in http::server::CWebServer::Do_Work() ()
#15 0x009f18fc in execute_native_thread_routine ()
#16 0x76e73fc4 in start_thread (arg=0x734c4430) at pthread_create.c:458
#17 0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 6 (Thread 0x73cc5430 (LWP 770)):
#0  0x76ccd704 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1  0x003f1c94 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
#2  0x003f2f48 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#3  0x003f3eb0 in boost::asio::io_context::run() ()
#4  0x009f18fc in execute_native_thread_routine ()
#5  0x76e73fc4 in start_thread (arg=0x73cc5430) at pthread_create.c:458
#6  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 5 (Thread 0x744c6430 (LWP 769)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x003c12a4 in CInfluxPush::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x744c6430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0x74f49430 (LWP 768)):
#0  0x76e7a9a4 in __pthread_cond_wait (cond=0xb9c178 <m_mainworker+480>, mutex=0xb9c160 <m_mainworker+456>) at pthread_cond_wait.c:188
#1  0x00270054 in boost::unique_lock<boost::shared_mutex>::lock() ()
#2  0x00260ae0 in CEventSystem::UpdateSingleState(unsigned long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, char const*, unsigned char, unsigned char, _eSwitchType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) ()
#3  0x002611ec in CEventSystem::ProcessDevice(int, unsigned long long, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#4  0x002ee49c in CSQLHelper::UpdateValueInt(int, char const*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) ()
#5  0x002efb44 in CSQLHelper::UpdateValue(int, char const*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) ()
#6  0x0062fcf8 in Plugins::CDevice_update(Plugins::CDevice*, _object*, _object*) ()
#7  0x75fdf1d8 in PyCFunction_Call () from /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
#8  0x76149950 in PyEval_EvalFrameEx () from /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
#9  0x761483b0 in PyEval_EvalFrameEx () from /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
#10 0x761c9624 in ?? () from /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0x7574a430 (LWP 762)):
#0  syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1  0x009ced5c in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >) ()
#2  0x002f09c4 in CSQLHelper::Do_Work() ()
#3  0x009f18fc in execute_native_thread_routine ()
#4  0x76e73fc4 in start_thread (arg=0x7574a430) at pthread_create.c:458
#5  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0x75f4b430 (LWP 756)):
#0  0x76e7f51c in __waitpid (pid=1825, stat_loc=0x75f4a5a0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x002d8570 in dumpstack_gdb(bool) ()
#2  0x002d8a94 in signal_handler(int, siginfo_t*, void*) ()
#3  <signal handler called>
#4  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x002d8d58 in Do_Watchdog_Work() ()
#6  0x009f18fc in execute_native_thread_routine ()
#7  0x76e73fc4 in start_thread (arg=0x75f4b430) at pthread_create.c:458
#8  0x76ccd038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x76f56e30 (LWP 755)):
#0  0x76e7ed60 in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00278278 in sleep_seconds(long) ()
#2  0x001f6620 in main ()

Main thread:
#0  0x76e7ed60 in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00278278 in sleep_seconds(long) ()
#2  0x001f6620 in main ()
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

okay, after a lot off restarts, updates etc it works again, do not know why
The script is working!
But when the lamp is off and i turn on color is does not work. First put the lamp on and then color does work.
So it cant execute two commands

@update: removing .checkfirst in action did the trick

Question 1: What does these lines do? do they have a function in the script?
local function other() -- you can define whatever actions you need in these functions.
dz.devices('device1').toggleSwitch().silent().afterSec(4)
end

local function dimTo(level)
Lidl.dimTo(level)
end

Question 2: can i also call this script from another script and putting the lamp to red without having red as an option in the selector switch ?

Question 3: is it possible to give two items in actions in one line in the selector switch example color 1 or color red

(red =
1. turn the lamp off then on
2. activate the color one time

other colors = groen =2 times, blauw 3 oranje 4, grijs 5, roze 6 paars 7

my tempory solution

Code: Select all

return {
            on =    {   devices =    { "usb lamp" }},   -- controller , define as virtual selector Switch with all level as named in action table 
                   
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Rood  =  dz.devices(1326)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)

        local function other()  -- you can define whatever actions you need in these functions.
            dz.devices('device1').toggleSwitch().silent().afterSec(4)
        end
        
        local function dimTo(level)
            Lidl.dimTo(level) 
        end
        
        actions = { Off       = function() triggerDevice_Off.switchOn() return end,
                    Aan       = function() triggerDevice_Aan.switchOn() return end,
                    Kleur     = function() triggerDevice_Aan.switchOn() triggerDevice_Kleur.switchOn() return end, 
                    Rood      = 
                        function() triggerDevice_Off.switchOn() 
                            triggerDevice_Aan.switchOn() 
                            triggerDevice_Kleur.switchOn() 
                        return end, 
                    Wit       = function() triggerDevice_Aan.switchOn() triggerDevice_Wit.switchOn() return end,
                    Flame     = function() triggerDevice_Aan.switchOn() triggerDevice_Flame.switchOn() return end, 
                    Play      = function() triggerDevice_Aan.switchOn() triggerDevice_Play.switchOn() return end, 
                    Dim       = function() triggerDevice_Aan.switchOn() triggerDevice_Dim.switchOn() return end, 
                    Speed     = function() triggerDevice_Aan.switchOn() triggerDevice_Speed.switchOn() return end, }
        
        actions[item.levelName]() -- Call required function with key = levelName 
    end
}   
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

pvklink wrote: Tuesday 07 May 2019 20:27 The script is working!
Nice !
What does these lines do?
They are not functional but are a leftover from the previous version.
Can i also call this script from another script and putting the lamp to red without having red as an option in the selector switch ?
Not direct but an option is to create a variable ( type string )and use the other script to set that variable. The content of the variable can be used to trigger any (set of ) action(s) ) you want.
The original script would then look as something like.

Code: Select all

return {
            on =    {   devices = { "usb lamp" }, -- controller , define as virtual selector Switch with all level as named in action table 
                        variables = { "controlVar" },   -- var, define as type string
                    },
                    
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Rood  =  dz.devices(1326)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)

        colors = { rood = 1,
                   groen = 2,
                   blauw = 3,
                   oranje = 4, 
                   grijs = 5,
                   roze = 6,
                   paars = 7,
                 }
        
        actions =   {   Off = function() triggerDevice_Off.switchOn() return end,
                        Aan = function() triggerDevice_Aan.switchOn() return end,
                        Kleur = function(color) 
                                    triggerDevice_Aan.switchOn() 
                                    triggerDevice_Kleur.switchOn().repeatAfterSec(0.1, colors[color] - 1) -- 0.1 works for virtual devices and Hue but not for rfLink
                                    return 
                                end,
                        Wit = function() triggerDevice_Aan.switchOn() triggerDevice_Wit.switchOn() return end,
                        Flame = function() triggerDevice_Aan.switchOn() triggerDevice_Flame.switchOn() return end,
                        Play = function() triggerDevice_Aan.switchOn() triggerDevice_Play.switchOn() return end,
                        Dim = function() triggerDevice_Aan.switchOn() triggerDevice_Dim.switchOn() return end,
                        Speed = function() triggerDevice_Aan.switchOn() triggerDevice_Speed.switchOn() return end, 
                    }
        
        if item.isDevice then
            actions[item.levelName]() -- Call required function with key = levelName 
        else -- item is variable
            for color, number in pairs(colors) do -- check if called with one of the defined colors
                if item.value == color then
                    actions["Kleur"](color) -- call the function with color as parameter
                    return -- ends this script
                end
            end
            if actions[item.value] then -- it was none of the defined colors
                actions[item.value]()   -- but exists in the actions table as key to a function 
            else
                dz.log("unknown action requested ( " .. item.value .." )",dz.LOG_ERROR )
            end
        end
    end
}    
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

get an little error:

2019-05-08 08:13:54.054 Status: dzVents: Error (2.4.18): Lidl: ...moticz/scripts/dzVents/generated_scripts/DZ_usb_lamp.lua:32: attempt to perform arithmetic on field '?' (a nil value)
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

pvklink wrote: Wednesday 08 May 2019 8:15 get an little error:

2019-05-08 08:13:54.054 Status: dzVents: Error (2.4.18): Lidl: ...moticz/scripts/dzVents/generated_scripts/DZ_usb_lamp.lua:32: attempt to perform arithmetic on field '?' (a nil value)
I do not have this error during tests. Can you copy / paste the script as you use it now and PM me ?
suspect something went wrong when copying it from the forum to your domoticz.
Are you using it as an internal or a external script ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

I get this error when i choose Kleur from the switch, level = Kleur

2019-05-08 11:49:49.078 Status: dzVents: Error (2.4.19): Lidl: An error occured when calling event handler DZ_usb_lamp
2019-05-08 11:49:49.078 Status: dzVents: Error (2.4.19): Lidl: ...moticz/scripts/dzVents/generated_scripts/DZ_usb_lamp.lua:32: attempt to perform arithmetic on field '?'

When i delete -1 in the script the error is gone!
triggerDevice_Kleur.switchOn().repeatAfterSec(0.1, colors[color] - 1)
but then i get the second color by default (green) when clicking one time on Kleur on the selector switch

i did not test defining a color in another script yet... when defining a color it has to click x times automaticly (red =1 etc.)
i also did not define a variable yet is that the problem?

Code: Select all

return {
            on =    {   devices = { "usb lamp" }, -- controller , define as virtual selector Switch with all level as named in action table 
                        variables = { "controlVar" },   -- var, define as type string
                    },
                    
        logging =   {   level     =   domoticz.LOG_ERROR,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Wit    = dz.devices(1327)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)
        
        colors = { rood = 1,
                   groen = 2,
                   blauw = 3,
                   oranje = 4, 
                   grijs = 5,
                   roze = 6,
                   paars = 7,
                 }
        actions =   {   Off = function() triggerDevice_Off.switchOn() return end,
                        Aan = function() triggerDevice_Aan.switchOn() return end,
                        Kleur = function(color) 
                                    triggerDevice_Aan.switchOn() 
                                    triggerDevice_Kleur.switchOn().repeatAfterSec(0.1, colors[color]) -- 0.1 works for virtual devices and Hue but not for rfLink
                                    return 
                                end,
                        Wit = function() triggerDevice_Aan.switchOn() triggerDevice_Wit.switchOn() return end,
                        Flame = function() triggerDevice_Aan.switchOn() triggerDevice_Flame.switchOn() return end,
                        Play = function() triggerDevice_Aan.switchOn() triggerDevice_Play.switchOn() return end,
                        Dim = function() triggerDevice_Aan.switchOn() triggerDevice_Dim.switchOn() return end,
                        Speed = function() triggerDevice_Aan.switchOn() triggerDevice_Speed.switchOn() return end, 
                    }
        
        if item.isDevice then
            actions[item.levelName]() -- Call required function with key = levelName 
        else -- item is variable
            for color, number in pairs(colors) do -- check if called with one of the defined colors
                if item.value == color then
                    actions["Kleur"](color) -- call the function with color as parameter
                    return -- ends this script
                end
            end
            if actions[item.value] then -- it was none of the defined colors
                actions[item.value]()   -- but exists in the actions table as key to a function 
            else
                dz.log("unknown action requested ( " .. item.value .." )",dz.LOG_ERROR )
            end
        end
    end
}    
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

Works almost perfect!

One error when selecting Kleur on the selector

2019-05-08 23:05:49.409 Status: dzVents: Error (2.4.19): Lidl: An error occured when calling event handler DZ_usb_lamp
2019-05-08 23:05:49.409 Status: dzVents: Error (2.4.19): Lidl: ...moticz/scripts/dzVents/generated_scripts/DZ_usb_lamp.lua:32: attempt to perform arithmetic on field '?' (a nil value)

Code: Select all

return {
            on =    {   devices = { "usb lamp" }, -- controller , define as virtual selector Switch with all level as named in action table 
                        variables = { "ledlampkleur" },   -- var, define as type string
                    },
              
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Default= dz.devices('usb lamp')
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Wit    = dz.devices(1327)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)

        colors = { rood = 1,
                   groen = 2,
                   blauw = 3,
                   oranje = 4, 
                   grijs = 5,
                   roze = 6,
                   paars = 7,
                 }
        actions =   {   Off = function() triggerDevice_Off.switchOn() return end,
                        --Aan = function() triggerDevice_Aan.switchOn() return end, -- default aanzetten
                        Aan = function() triggerDevice_Aan.switchOn() triggerDevice_Default.switchSelector(40) return end, -- default aanzetten does work but gives an error
                        Kleur = function(color) 
                                    triggerDevice_Aan.switchOn() triggerDevice_Kleur.switchOn().repeatAfterSec(0.1, colors[color]-1) -- 0.1 works for virtual devices and Hue but not for rfLink
                                    return 
                                end,
                        Wit = function() triggerDevice_Aan.switchOn() triggerDevice_Wit.switchOn() return end,
                        Flame = function() triggerDevice_Aan.switchOn() triggerDevice_Flame.switchOn() return end,
                        Play = function() triggerDevice_Aan.switchOn() triggerDevice_Play.switchOn() return end,
                        Dim = function() triggerDevice_Aan.switchOn() triggerDevice_Dim.switchOn() return end,
                        Speed = function() triggerDevice_Aan.switchOn() triggerDevice_Speed.switchOn() return end, 
                    }


        if item.isDevice then
            dz.variables('ledlampkleuroud').set(dz.devices('usb lamp').lastLevel)
            actions[item.levelName]() -- Call required function with key = levelName 
        
        else -- item is variable

            for color, number in pairs(colors) do -- check if called with one of the defined colors
                if item.value == color then
                    triggerDevice_Off.switchOn() 
                    actions["Kleur"](color) -- call the function with color as parameter
                    return -- ends this script
                end
            end
            if actions[item.value] then -- it was none of the defined colors
                actions[item.value]()   -- but exists in the actions table as key to a function 
            else
                dz.log("unknown action requested ( " .. item.value .." )",dz.LOG_ERROR )
            end
        end
    end
}    

Code: Select all

return {
	on = {devices = {'test'}},   

    logging =   { level   = domoticz.LOG_ERROR ,                  -- Uncomment to override the dzVents global logging setting
                  marker  = "test"},
	
    execute = function(dz, device, info)

    if device.state == 'On' then                               
        dz.devices('usb lamp').switchSelector(20)               -- anders gaat t wel aan maar staat de selector niet op aan
        dz.variables('ledlampkleur').set('groen')
    else
        dz.devices('usb lamp').switchSelector(dz.variables('ledlampkleuroud').value)
	end
end
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

pvklink wrote: Wednesday 08 May 2019 12:31 Works almost perfect!
Can you please check this version ?

Code: Select all

return {
            on =    {   devices = { "usb lamp" }, -- controller , define as virtual selector Switch with all level as named in action table 
                        variables = { "controlVar" },   -- var, define as type string
                    },
                    
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Rood  =  dz.devices(1326)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)

        colors = { rood = 1,
                   groen = 2,
                   blauw = 3,
                   oranje = 4, 
                   grijs = 5,
                   roze = 6,
                   paars = 7,
                 }
        
        actions =   {   Off = function() triggerDevice_Off.switchOn() return end,
                        Aan = function() triggerDevice_Aan.switchOn() return end,
                        Kleur = function(color) 
                                    triggerDevice_Aan.switchOn() 
                                    triggerDevice_Kleur.switchOn().repeatAfterSec(0.1, tonumber(colors[color] or 1)  - 1)
                                    return 
                                end,
                        Wit = function() triggerDevice_Aan.switchOn() triggerDevice_Wit.switchOn() return end,
                        Flame = function() triggerDevice_Aan.switchOn() triggerDevice_Flame.switchOn() return end,
                        Play = function() triggerDevice_Aan.switchOn() triggerDevice_Play.switchOn() return end,
                        Dim = function() triggerDevice_Aan.switchOn() triggerDevice_Dim.switchOn() return end,
                        Speed = function() triggerDevice_Aan.switchOn() triggerDevice_Speed.switchOn() return end, 
                    }
        
        local function isColorAction( action )
            for color, number in pairs(colors) do -- check if called with one of the defined colors
                if action == color then
                    actions["Kleur"](color)
                    return true
                end
            end
            return false
        end
        
        local function doAction( action )
            if actions[action] then
                dz.log("known action requested ( " .. action .." )",dz.LOG_DEBUG )
                actions[action]()    -- Call required function with key = action
            else
               dz.log("unknown action requested ( " .. action .." )",dz.LOG_ERROR )
               return false
            end
        end
        
        if item.isDevice and ( not ( isColorAction(item.levelName) ) ) then 
            doAction(item.levelName) 
        elseif item.isVariable and ( not ( isColorAction(item.value) ) ) then 
            doAction(item.value) 
        end
    end
}      
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

I will test the script this evening !
And my RGB lamp now turns blue when my irrigationsystem is watering the garden!
and when it is finished it turns the color back to the state before :D
All your scripts come together now!

still to do (somethings with for x seconds , is that possible with the current solution that is changing a uservariable that triggers the script on or off?)
When the doorbell, smoke, or alarm rings it turns <color> for x seconds and then returns to the state before
When the wasmachine is finished yellow for...

Many thanks
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

After pushing "Kleur" from the selector switch i get:

Code: Select all

2019-05-09 19:31:05.944 Status: User: Admin initiated a switch command (1358/usb lamp/Set Level)
2019-05-09 19:31:06.150 (broadlink2) Pushing 'onCommandCallback' on to queue
2019-05-09 19:31:06.151 (broadlink2) Pushing 'onCommandCallback' on to queue
2019-05-09 19:31:06.199 (broadlink2) Processing 'onCommandCallback' message
2019-05-09 19:31:06.202 (broadlink2) Calling message handler 'onCommand'.
2019-05-09 19:31:06.203 (broadlink2) onCommand called for Unit 10: Parameter 'On', Level: 0 , Connected : True
2019-05-09 19:31:06.203 (broadlink2) Generate on Command for learned code stored on unit/ini :10
2019-05-09 19:31:06.207 (broadlink2) Code loaded : 26004800000129931411121411131214111413121114113913121312121313121214121214111238141114121312131213111411141114371114131213121114131213121312143614000d05
2019-05-09 19:31:06.207 (broadlink2) b'&\x00H\x00\x00\x01)\x93\x14\x11\x12\x14\x11\x13\x12\x14\x11\x14\x13\x12\x11\x14\x119\x13\x12\x13\x12\x12\x13\x13\x12\x12\x14\x12\x12\x14\x11\x128\x14\x11\x14\x12\x13\x12\x13\x12\x13\x11\x14\x11\x14\x11\x147\x11\x14\x13\x12\x13\x12\x11\x14\x13\x12\x13\x12\x13\x12\x146\x14\x00\r\x05'
2019-05-09 19:31:06.441 (broadlink2) Code Sent....
2019-05-09 19:31:06.441 (broadlink2) <b> Command line : "/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" /home/pi/domoticz/BroadlinkRM2ini/BroadlinkRM2-26-10.ini </b>
2019-05-09 19:31:06.442 ($usb lamp aan) Updating device from 1:'On-791' to have values 1:'On-793'.
2019-05-09 19:31:06.447 (broadlink2) Update 1:'On-793' ($usb lamp aan)
2019-05-09 19:31:06.448 (broadlink2) Processing 'onCommandCallback' message
2019-05-09 19:31:06.448 (broadlink2) Calling message handler 'onCommand'.
2019-05-09 19:31:06.448 (broadlink2) onCommand called for Unit 14: Parameter 'On', Level: 0 , Connected : True
2019-05-09 19:31:06.448 (broadlink2) Generate on Command for learned code stored on unit/ini :14
2019-05-09 19:31:06.451 (broadlink2) Code loaded : 26007c000b000b640001269512381239131213121313121312131237133713381213131312131213121312371239133713121313121312131213123713381337121313131213121312131238130005ac0001274b12000c590001274b12000c580001274c11000c590001274b12000c590001274b12000c590001274b13000d05000000000000000000000000
2019-05-09 19:31:06.451 (broadlink2) b"&\x00|\x00\x0b\x00\x0bd\x00\x01&\x95\x128\x129\x13\x12\x13\x12\x13\x13\x12\x13\x12\x13\x127\x137\x138\x12\x13\x13\x13\x12\x13\x12\x13\x12\x13\x127\x129\x137\x13\x12\x13\x13\x12\x13\x12\x13\x12\x13\x127\x138\x137\x12\x13\x13\x13\x12\x13\x12\x13\x12\x13\x128\x13\x00\x05\xac\x00\x01'K\x12\x00\x0cY\x00\x01'K\x12\x00\x0cX\x00\x01'L\x11\x00\x0cY\x00\x01'K\x12\x00\x0cY\x00\x01'K\x12\x00\x0cY\x00\x01'K\x13\x00\r\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2019-05-09 19:31:06.118 Status: dzVents: Info: Lidl: ------ Start internal script: backup_lamp: Device: "usb lamp (dummydevices)", Index: 1358
2019-05-09 19:31:06.120 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp uit: Switch device adapter
2019-05-09 19:31:06.121 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp aan: Switch device adapter
2019-05-09 19:31:06.122 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp kleur: Switch device adapter
2019-05-09 19:31:06.123 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp white: Switch device adapter
2019-05-09 19:31:06.124 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp kaars: Switch device adapter
2019-05-09 19:31:06.125 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp play pause: Switch device adapter
2019-05-09 19:31:06.126 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp dim: Switch device adapter
2019-05-09 19:31:06.127 Status: dzVents: Debug: Lidl: Processing device-adapter for $usb lamp speed: Switch device adapter
2019-05-09 19:31:06.128 Status: dzVents: Debug: Lidl: Constructed timed-command: On
2019-05-09 19:31:06.128 Status: dzVents: Debug: Lidl: Constructed timed-command: On
2019-05-09 19:31:06.128 Status: dzVents: Error (2.4.19): Lidl: An error occured when calling event handler backup_lamp
2019-05-09 19:31:06.128 Status: dzVents: Error (2.4.19): Lidl: ...moticz/scripts/dzVents/generated_scripts/backup_lamp.lua:31: attempt to perform arithmetic on field '?' (a nil value)
2019-05-09 19:31:06.128 Status: dzVents: Info: Lidl: ------ Finished backup_lamp
2019-05-09 19:31:06.128 Status: dzVents: Info: Lidl: ------ Start internal script: DZ_usb_lamp: Device: "usb lamp (dummydevices)", Index: 1358
2019-05-09 19:31:06.128 Status: dzVents: Debug: Lidl: known action requested ( Kleur )
2019-05-09 19:31:06.128 Status: dzVents: Debug: Lidl: Constructed timed-command: On
2019-05-09 19:31:06.129 Status: dzVents: Debug: Lidl: Constructed timed-command: On
2019-05-09 19:31:06.129 Status: dzVents: Debug: Lidl: Constructed timed-command: On REPEAT 1 INTERVAL 0.1 SECONDS
2019-05-09 19:31:06.129 Status: dzVents: Info: Lidl: ------ Finished DZ_usb_lamp
2019-05-09 19:31:06.131 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-05-09 19:31:06.150 Status: Set UserVariable ledlampkleuroud = 20
2019-05-09 19:31:07.423 (broadlink2) Code Sent....
2019-05-09 19:31:07.423 (broadlink2) <b> Command line : "/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" /home/pi/domoticz/BroadlinkRM2ini/BroadlinkRM2-26-14.ini </b>
2019-05-09 19:31:07.423 ($usb lamp kleur) Updating device from 1:'On-792' to have values 1:'On-794'.
2019-05-09 19:31:07.434 (broadlink2) Update 1:'On-794' ($usb lamp kleur)
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents rgb broadlink

Post by waaren »

Do not see why this error occurs. Please check with new script where I added extra log statements. Hopefully that will give enough information to see what is causing the error. This script is also ready for your request to do something for x seconds.

Code: Select all

local controlVar = "controlVar"  -- var, define as type string

return {
            on =    {   devices = { "usb lamp" }, -- controller , define as virtual selector Switch with all level as named in action table 
                        variables = { controlVar },   -- var, define as type string
                    },
                    
        logging =   {   level     =   domoticz.LOG_DEBUG,
                        marker    =   "Lidl"   },

    execute = function(dz, item)
        local triggerDevice_Off    = dz.devices(1323)
        local triggerDevice_Aan    = dz.devices(1322)
        local triggerDevice_Kleur  = dz.devices(1326)
        local triggerDevice_Rood  =  dz.devices(1326)
        local triggerDevice_Flame  = dz.devices(1325)
        local triggerDevice_Play   = dz.devices(1328)
        local triggerDevice_Dim    = dz.devices(1324)
        local triggerDevice_Speed  = dz.devices(1361)
        
        local controlVar = dz.variables(controlVar)
        
        colors = { rood = 1,
                   groen = 2,
                   blauw = 3,
                   oranje = 4, 
                   grijs = 5,
                   roze = 6,
                   paars = 7,
                 }
        
        actions =   {   Off = function() triggerDevice_Off.switchOn() return end,
                        Aan = function() triggerDevice_Aan.switchOn() return end,
                        Kleur = function(color) 
                                    triggerDevice_Aan.switchOn() 
                                    local repeats = (( colors[color] or 1 ) - 1)
                                    dz.log("Color requested :" .. tostring(color) .. "==>> repeats required " .. repeats ,dz.LOG_DEBUG )
                                    triggerDevice_Kleur.switchOn().repeatAfterSec(0.1, repeats )
                                    return 
                                end,
                        Wit = function() triggerDevice_Aan.switchOn() triggerDevice_Wit.switchOn() return end,
                        Flame = function() triggerDevice_Aan.switchOn() triggerDevice_Flame.switchOn() return end,
                        Play = function() triggerDevice_Aan.switchOn() triggerDevice_Play.switchOn() return end,
                        Dim = function() triggerDevice_Aan.switchOn() triggerDevice_Dim.switchOn() return end,
                        Speed = function() triggerDevice_Aan.switchOn() triggerDevice_Speed.switchOn() return end, 
                    }
        
        local function setVar( request )
            if controlVar.value ~= request then
                controlVar.set(request).silent()
            end
        end
        
        local function isColorAction( action )
            for color, number in pairs(colors) do -- check if called with one of the defined colors
                if action == color then
                    setVar(color)
                    actions["Kleur"](color)
                    return true
                end
            end
            return false
        end
        
        local function doAction( action )
            if actions[action] then
                dz.log("known action requested ( " .. action .." )",dz.LOG_DEBUG )
                setVar(action)
                actions[action]()    -- Call required function with key = action
            else
               dz.log("unknown action requested ( " .. action .." )",dz.LOG_ERROR )
               return false
            end
        end
        
        if item.isDevice and ( not ( isColorAction(item.levelName) ) ) then 
            doAction(item.levelName) 
        elseif item.isVariable and ( not ( isColorAction(item.value) ) ) then 
            doAction(item.value) 
        end

    end
}
to enable the option to do an action on this device for xx seconds and return to previous state, add the code below to global_data.lua in the helpers = { } section

Code: Select all

                    alertLidl = function(dz, action, period)
                        local controlVar = dz.variables("controlVar")
                        local value = controlVar.value
                        if controlVar.value ~= action then
                            controlVar.set(action) 
                            controlVar.set(value).afterSec(period)
                            dz.log("alert requested; controlVar set to " .. action .. 
                                    ". It will return to ".. value .. " after " .. period .. 
                                    " seconds." ,dz.LOG_FORCE)
                        else
                            dz.log("No changed needed; controlVar is already set to " .. value,dz.LOG_DEBUG)
                        end
                    end,
After that you can call this helper function from any other dzVents script with
dz.helpers.alertLidl(dz, color, seconds)

Code: Select all

dz.helpers.alertLidl(dz, "paars", 12)
if the last set state of the light is not paars it will switch to paars for 12 seconds after which it will return to its previous set state.
Please note that this is not fail proof because of a possible scenario like:

Code: Select all

time colour 
0:00 red
0:01 blue       -- set by dishwasher ready script for 30 seconds after it will return to red
0:05 yellow   -- set by washer ready script for 40 seconds after it will return to blue
0:31 red        -- timer for dishwasher alert finished
0:45 blue      -- timer for washer alert finished 
Have fun !
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

I will, first install my rpi ...it crashed with latest raspbian/domoticz versions..
tried to reanimate it....
others buy a new one tomorrow...
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents rgb broadlink

Post by pvklink »

Hi @waaren.

Installed my domoticz again ... lot of work
-- broadlink, chromecast,ikea, hue, rfx, p1, zwave, mqtt, nodered and everything seems to be ok now....

I upgraded the script like you said,
And added theo global helper, dont know if i did that right, see below...

Code: Select all

return {
	-- global persistent data
	data = {
		myGlobalVar = { initial = 12 }
	},

	-- global helper functions
	helpers = {
		myHelperFunction = function(domoticz)
			-- code
		end

                alertLidl = function(dz, action, period)
                        local controlVar = dz.variables("controlVar")
                        local value = controlVar.value
                        if controlVar.value ~= action then
                            controlVar.set(action) 
                            controlVar.set(value).afterSec(period)
                            dz.log("alert requested; controlVar set to " .. action .. 
                                    ". It will return to ".. value .. " after " .. period .. 
                                    " seconds." ,dz.LOG_FORCE)
                        else
                            dz.log("No changed needed; controlVar is already set to " .. value,dz.LOG_DEBUG)
                        end
                end,
	}
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest