• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[8.1.2] kaku_dimmer unexpected reaction
#11
What's the config again?
Also, the latest nightly version should be: v8.1.2-nightly-4e408d75 or if installed through apt: 8.1.2-31-g4e408d75

I tested with:
Code:
{
        "devices": {
                "dimmer": {
                        "protocol": [ "kaku_dimmer" ],
                        "id": [{
                                "id": 1175,
                                "unit": 0
                        }],
                        "state": "on",
                        "dimlevel-minimum": 0,
                        "dimlevel-maximum": 15,
                        "dimlevel": 13
                },
                "switch": {
                        "protocol": [ "generic_switch" ],
                        "id": [{
                                "id": 1
                        }],
                        "state": "on"
                }
        },
        "rules": {
                "foo": {
                        "rule": "IF switch.state == on THEN dim DEVICE dimmer TO 13 FROM 0 IN '15 SECOND' AFTER '1 SECOND'",
                        "active": 1
                },
                "foo1": {
                        "rule": "IF switch.state == off THEN dim DEVICE dimmer TO 0 FROM 13 IN '15 SECOND' AFTER '1 SECOND'",
                        "active": 1
                }
        },
        "gui": {
                "dimmer": {
                        "name": "Foo",
                        "group": [ "Main" ],
                        "media": [ "all" ]
                },
                "switch": {
                        "name": "Bar",
                        "group": [ "Main" ],
                        "media": [ "all" ]
                }
        },
        "settings": {},
        "hardware": {},
        "registry": {}
}
 
Reply
#12
I updated again this moment an version is now v8.1.2-nightly-4e408d75.
In a short test with the Testrule it seems to work perfect now.
Also no more error in the logfile.
Further testing this evening, thank you!
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#13
Let me know when you fully tested everything.
 
Reply
#14
Dimming up and down works now as expected but the dimmer will not switch off when dimlevel == 0.

When the rule is ready the dimlevel shows '1' (not '0') in the GUI, state switches to 'off' but does not switch to off in real.
The lamp will still light up.
Although quite weak but it shines.

btw: Why is the logfile actually no longer showing which rule was executed when?
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#15
Quote:When the rule is ready the dimlevel shows '1' (not '0') in the GUI, state switches to 'off' but does not switch to off in real.
That's interesting. Does it switch off when you manually control it?

Quote:btw
BTW means a new topic. Or else things get messy.
 
Reply
#16
Manually switching the dimmer in the gui from on to off and also back works.

When i move the slider to 0 the state in gui switches to off but the light is still on.
Then i have to switch the state to on an back to off for really switching off the dimmer.
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#17
Ok, thanks for reporting. I will investigate it again.
 
Reply
#18
Can you check my fix in staging?
 
Reply
#19
Tested now.

Rule works:

Code:
"99-Testregel": {
    "rule": "IF sw2.state == on AND zeit.second == 0 THEN dim DEVICE spotli TO (spotli.dimlevel - 1) AFTER '3 SECOND'",
    "active": 1
}

But does not switch off the dimmer when dimlevel == 0
   

and the logfile shows this error:

Code:
[Sep 17 19:59:33:871879] pilight-daemon: INFO: version v8.1.2-nightly-8d6ccc37
[Sep 17 19:59:33:911841] pilight-daemon: INFO: daemon listening to port: 5000
[Sep 17 19:59:33:959794] pilight-daemon: INFO: secured webserver started on port: 5002 (fd 13)
[Sep 17 19:59:33:960097] pilight-daemon: INFO: regular webserver started on port: 5001 (fd 14)
[Sep 17 19:59:34:9029]   pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 34982
[Sep 17 19:59:34:128488] pilight-daemon: NOTICE: no pilight ssdp connections found
[Sep 17 19:59:34:130528] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 34984
[Sep 17 20:01:03:71433]  pilight-daemon: ERROR: /usr/local/lib/pilight/actions/dim.lua:317: device "spotli" could not be set to dimlevel "-1"
[Sep 17 20:02:03:47792]  pilight-daemon: ERROR: /usr/local/lib/pilight/actions/dim.lua:317: device "spotli" could not be set to dimlevel "-1"
[Sep 17 20:05:03:63124]  pilight-daemon: ERROR: /usr/local/lib/pilight/actions/dim.lua:317: device "spotli" could not be set to dimlevel "-1"
[Sep 17 20:06:03:78894]  pilight-daemon: ERROR: /usr/local/lib/pilight/actions/dim.lua:317: device "spotli" could not be set to dimlevel "-1"
root@terrari:/home/pi#
When adding this rule switchin off is working now:

Code:
"Dimmer_links_aus_wenn_0": {
    "rule": "IF spotli.dimlevel == 0 AND spotli.state == on THEN switch DEVICE spotli TO off AFTER '10 SECOND'",
    "active": 1
},
So for me it seems to work now.
Only the error messages in the logfile are strange.

One thing is problematic:
Because of the rule above (Testrule99) pilight service is not able to start as soon as the saved dimlevel is <1.
pilight-daemon -D brings this:

Code:
[Sep 17 20:25:40:398909] pilight-daemon: ERROR: /usr/local/lib/pilight/actions/dim.lua:149: device "spotli" can't be set to dimlevel "-1"
[Sep 17 20:25:40:400627] pilight-daemon: INFO: rule #9 99-Testregel was parsed in 0.025130 seconds
[Sep 17 20:25:40:403906] pilight-daemon: ERROR: failed to read config
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#20
(09-17-2018, 09:12 PM)terrar Wrote: But does not switch off the dimmer when dimlevel == 0
True, that's as intended.

Quote:and the logfile shows this error:
Investigating.

Quote:So for me it seems to work now.
That's indeed how it's done.

--------------------

It's so great that have such great testers like you. I did some fixes. However, to get that rule of yours working, i've pushed two new functions. MIN and MAX.
Code:
IF sw2.state == on AND zeit.second == 0 THEN dim DEVICE spotli TO MAX(0, spotli.dimlevel - 1) AFTER '3 SECOND'

Awaiting your tests Smile
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)