[SOLVED] Since switch to OH 2 simple On off rule does not work anymore

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage
    • OS: what OS is used and which version
    • Java Runtime Environment: JDK 8.192
    • openHAB version: 2.3.0
  • Issue of the topic: FIBARO RGBW controller and wall switch. Rule does work if Basic UI sitch is used but not if the wall switch is pressed. the event triggered on the logs is the same

Item ‘EsZi_Lampe_Dimmer’ received command ON

but if it is triggered by the wall switch it does not execute the rule. Also the virtual “basic ui switch” is not changed to on. If the wall switch is pressed. It was working 3 years with OH 1 without any issue. And I do not have any idea anymore. Tried it also with if item changed from OFF to ON or from 0 to 100. Same results :frowning:
Anybody and idea suggestion?

Thx in advance

Michael

  • Please post configurations (if applicable):

    • Items configuration related to the issue
//Items Esszimmerlampe

Dimmer	EsZi_Lampe_Dimmer				"Esszimmerlampe Dimmer"		(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer"}
Number	EsZi_Lampe_SensorPower			"RGBW Verbrauch kWh [%s]"	(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:sensor_power"}
Number	EsZi_Lampe_ElectricMeterWatts	"RGBW Watt [%s]"			(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:meter_watts"}
Number	EsZi_Lampe_ElectricMeterKWh		"RGBW kWh [%s]"				(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:meter_kwh"}
Color	EsZi_Lampe_Color				"RGBW Farbe [%s]"			(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:color_color"}
Number	EsZi_Lampe_StartAnimation		"RGBW Scene [%s]"			(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:scene_number_param72"}
Dimmer	EsZi_Lampe_Rot					"Rot [%d]"					(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer2"}
Dimmer	EsZi_Lampe_Blau					"Gruen [%d]"				(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer3"}
Dimmer	EsZi_Lampe_Gruen				"Blau [%d]"					(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer4"}
Dimmer	EsZi_Lampe_Weiss				"Weiss [%d]"				(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer5"}
  • Sitemap configuration related to the issue
sitemap wizzo label="Wielands Resort" {
    Slider	item=EsZi_Lampe_Dimmer		label="Weiss"						icon="Light"
	Switch	item=EsZi_Lampe_Dimmer		label="Schalter Weiss"				icon="Switch"
	Text	item=EsZi_Lampe_Dimmer		label="Esszimmer Lampe [%.0f %%]"	icon="Light" 
	Switch	item=EsZi_Lampe_Weiss		label="Licht Aus / An [%.0f %%]"	icon="Switch"				
	Switch	item=EsZi_Lampe_Weiss		label="Hauptlicht"					icon="Light" mappings=[5="5%", 50="50%", 100="100%"]
//Colorpicker item=EsZi_Lampe_Color 	label="RGB Farbwaehler  [%.0f %%]"	icon="Light"	
	Slider	item=EsZi_Lampe_Weiss 		label="Weiss[%.0f %%]"				icon="Light" 
	Slider	item=EsZi_Lampe_Rot			label="Rot [%.0f %%]"				icon="Light" valuecolor=["red"]
	Slider	item=EsZi_Lampe_Gruen 		label="Gruen [%.0f %%]"				icon="Light" valuecolor=["lightgreen"]
	Slider	item=EsZi_Lampe_Blau 		label="Blau [%.0f %%]"				icon="Light" valuecolor=["blue"]
    
	}
  • Rules code related to the issue
rule "Esszimmerlampe einschalten"
when
        Item 'EsZi_Lampe_Dimmer' received command ON
then
        sendCommand(EsZi_Lampe_Gruen, 100)
		sendCommand(EsZi_Lampe_Weiss, 25)
		sendCommand(EsZi_Lampe_Blau, 25)
end

rule "Esszimmerlampe ausschalten"
when
        Item 'EsZi_Lampe_Dimmer' received command OFF
then
        sendCommand(EsZi_Lampe_Rot, OFF)
        sendCommand(EsZi_Lampe_Blau, OFF)
		sendCommand(EsZi_Lampe_Gruen, OFF)
		sendCommand(EsZi_Lampe_Weiss, OFF)
end
  • Services configuration related to the issue
  • If logs where generated please post these here using code fences:
2018-11-07 21:02:23.930 [vent.ItemStateChangedEvent] - network_servicedevice_192_168_176_4_80_lastseen changed from 2018-11-07T21:01:23.924+0100 to 2018-11-07T21:02:23.927+0100
2018-11-07 21:02:58.411 [ome.event.ItemCommandEvent] - Item 'EsZi_Lampe_Dimmer' received command ON
2018-11-07 21:02:58.415 [vent.ItemStateChangedEvent] - EsZi_Lampe_Dimmer changed from 0 to 100
2018-11-07 21:02:58.416 [vent.ItemStateChangedEvent] - zwave_serial_zstick_daa8ab19_serial_ack changed from 762 to 763
2018-11-07 21:02:58.422 [vent.ItemStateChangedEvent] - zwave_serial_zstick_daa8ab19_serial_sof changed from 2073 to 2074
2018-11-07 21:02:58.439 [vent.ItemStateChangedEvent] - zwave_serial_zstick_daa8ab19_serial_sof changed from 2074 to 2075
2018-11-07 21:03:08.701 [ome.event.ItemCommandEvent] - Item 'EsZi_Lampe_Dimmer' received command OFF
2018-11-07 21:03:08.703 [vent.ItemStateChangedEvent] - EsZi_Lampe_Dimmer changed from 100 to 0
2018-11-07 21:03:08.704 [vent.ItemStateChangedEvent] - zwave_serial_zstick_daa8ab19_serial_ack changed from 763 to 764
2018-11-07 21:03:08.711 [vent.ItemStateChangedEvent] - zwave_serial_zstick_daa8ab19_serial_sof changed from 2075 to 2076
2018-11-07 21:03:08.728 [vent.ItemStateChangedEvent] - zwave_serial_zstick_daa8ab19_serial_sof changed from 2076 to 2077

Have you tried setting the association group 5 to Controller?

@OMR I can only guess, but this looks like the new experimental Rules! The OP was using standard rules Files!
@wizzo try removing the 'singles quotes around the item name in the when part of the rules. Additionally you can add logInfo statements in the rule in order to get a feedback if the rule is started or not.

Ehh, no. It’s the Association setting for the device in PaperUI.
Looks like this in habmin:

Try it without the simple quotes for the “Item” in your rules like this

rule "Esszimmerlampe einschalten"
when
        Item EsZi_Lampe_Dimmer received command ON
then
        sendCommand(EsZi_Lampe_Gruen, 100)
		sendCommand(EsZi_Lampe_Weiss, 25)
		sendCommand(EsZi_Lampe_Blau, 25)
end

rule "Esszimmerlampe ausschalten"
when
        Item EsZi_Lampe_Dimmer received command OFF
then
        sendCommand(EsZi_Lampe_Rot, OFF)
        sendCommand(EsZi_Lampe_Blau, OFF)
		sendCommand(EsZi_Lampe_Gruen, OFF)
		sendCommand(EsZi_Lampe_Weiss, OFF)
end

Maybe that’s a solution

Quotes here never has been correct, but OH2 is less forgiving about requiring correct formats.

As an addition to that -

Slider item=EsZi_Lampe_Dimmer label="Weiss" icon="Light" ...

your icons should have lowercase file names, so for consistency you’d want to use lowercase in the Sitemap as well. I don’t know if it could cause any actual problems though.

A rule triggered by command to Item never would have been triggered by a wall switch event, even in OH1. Maybe the rule wasn’t necessary in that case

I’m fairly sure that should work with a Dimmer Item as you expect. Try refreshing the webpage, to make sure it isn’t just a refresh issue.

Hi Thx a lot for all the replys.

@fibu-freak I forgot to mention that I laso tried it without the quotes. Same thing.

@rossko57 If I use the wall switch it also triggers the “comand ON” at kleast thats visible in the logs so my assumpütion is that it would also execute the rule, anmd it was definitely workign in OH 1 as I was using it 3 years. On Rasperry and on windows install. as the rulke is turnming on additional RGB LEDs.
I will give the “dimmer” a try and see if that changes anything.

@OMR Do I need to use HABmin to get that sorted…I know I did a lot with Habmin in OH1 but I thought the items and the rules is streight forward

I will give the “dimmer” a try and see if that changes anything. Keep you updated.

Keep you updated.
Thx a lot

Hi, the item is a dimmer object, but that does not do any differnce. Regardless if I use a dimmer or a switch :frowning:

It won’t do, if the controller doesn’t get the info from association group 5.
For test, I would do a:

tail -F /var/log/openhab2/events.log

just to see if the controller is registering the event from the dimmer item.

I recently had to set the association group 1 to Controller in all my Fibaro Dimmer2s in order to register local S1/S2 operations. I cannot test with the actual RGBW controller for you, since I don’t have any switches connected to it.

I did post example of both PaperUI and Habmin. Take your pick :slight_smile:

Where do I find those assoziation groups?

In paperUI:


Try associating Group 5 with Controller.

In Habmin:

Thx a lot, that does triggger a lot mor reportings into the console (log) Is it possible to define a “state” like if somethign is chaning from 0 to >0 it is interpreted as on and if the value is changing from >0 to =0 it is hjandled as off?

Hi it does not save the reporting setting. :frowning:


Do I need to select somethign for the IN 1

I think you can assign both a Switch and a Dimmer to the switch_dimmer channel:

Example from an Ikea Trådfi item that was changed in order to comply with other OH2 items and the Eclipse SH framework:

Switch TradfriP5State             (kitchen, lights)      { channel = "tradfri:0220:gwb072bf25aee1:65585:brightness" }
Dimmer TradfriP5Bright            (kitchen)              { channel = "tradfri:0220:gwb072bf25aee1:65585:brightness" }

In your case:

Dimmer	EsZi_Lampe_Dimmer				"Esszimmerlampe Dimmer"		(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer"}
Switch	EsZi_Lampe_Switch				"Esszimmerlampe Dimmer"		(gEsZiLampe)	{channel="zwave:device:daa8ab19:node3:switch_dimmer"}

Worth a try …

Also, during a test period, you could change the rule trigger to ‘received update’ and add a log line:

Example:

rule "Trumpet 4 - Effect"
when
    Item vBulbTrumpet4Effect received update
then
    logInfo("deconz", "vBulbTrumpet4Effect=" + vBulbTrumpet4Effect.state)
end

When you get that working, you will see what happens, and change back to trigger ‘changed’ etc…

gimme a few minutes :-D…isn´t there a chat function available? :flight_departure:

Known bug in paperUI. Just try again until it sticks.
If you don’t need reports from the 1-4 inputs, you are fine.
If you do, search the forum for detailed instructions.

I believe the “wall switch” is the IN1 so it should report to z-wave controller as well I assume
my HABmin does not save anythign either do I need to change something?

Check:

found the stuff in habmin…lets see if that does any difference