Today I managed to flash and add a couple of sonoff basic switches which are working fine in my Habpanel. I only managed this after reading and watching numerous tutorials. I also flashed a sonoff 3 gang T1 but have no idea how to write an item file for it as it has 3 switches in one item…I think. I have googled galore but can not find anything. Can someone please help with a sample for a 3 gang sonoff T1.
Much appreciated.
James
Forgot to mention, here is existing item file. First two work fine but need 3 channels for 3rd item.
//Sonoff Basic / Sonoff S20 Smart Socket
Switch SB_01 “Outside Front Light” (Outside_Lights){ mqtt=">[broker:cmnd/SB_01/power:command:*:default],<[broker:stat/SB_01/POWER:state:default]" }
Switch SB_02 “Outside Front Light 2” (Outside_Lights){ mqtt=">[broker:cmnd/SB_02/power:command:*:default],<[broker:stat/SB_02/POWER:state:default]" }
Switch SW3_01 “Lounge Dinning Light” (Lounge_Dinning_Lights){ mqtt=">[broker:cmnd/SW3_01/power:command:*:default],<[broker:stat/SW3_01/POWER:state:default]" }
The topic is slightly different for T1. Given a T1 with Topic ST1_01
it would be like this:
//Sonoff T1
Switch ST1_01_1 "Channel1" { mqtt=">[broker:cmnd/ST1_01/power1:command:*:default],<[broker:stat/ST1_01/POWER1:state:default]" }
Switch ST1_01_2 "Channel2" { mqtt=">[broker:cmnd/ST1_01/power2:command:*:default],<[broker:stat/ST1_01/POWER2:state:default]" }
Switch ST1_01_3 "Channel3" { mqtt=">[broker:cmnd/ST1_01/power3:command:*:default],<[broker:stat/ST1_01/POWER3:state:default]" }
Giving that a try now, Ill let you know how I go.
Thanks very much for the quick response.
I’m not sure what i did wrong but now the two basic devices have disappeared from items and the new T1 switch is not there. Here is the file now with topic actual name.
//Sonoff Basic
Switch SB_01 “Outside Front Light” (Outside_Lights){ mqtt=">[broker:cmnd/SB_01/power:command:*:default],<[broker:stat/SB_01/POWER:state:default]" }
Switch SB_02 “Outside Front Light 2” (Outside_Lights){ mqtt=">[broker:cmnd/SB_02/power:command:*:default],<[broker:stat/SB_02/POWER:state:default]" }
//Sonoff T1
Switch SW3_01_1 “Channel1” (Outside_Lights){ mqtt=">[broker:cmnd/SW3_01/power1:command::default],<[broker:stat/SW3_01/POWER1:state:default]" }
Switch SW3_01_2 “Channel2” (Outside_Lights){ mqtt=">[broker:cmnd/SW3_01/power2:command::default],<[broker:stat/SW3_01/POWER2:state:default]" }
Switch SW3_01_3 “Channel3” (Outside_Lights){ mqtt=">[broker:cmnd/SW3_01/power3:command:*:default],<[broker:stat/SW3_01/POWER3:state:default]" }
I guess you are missing the display on the sitemap, could you post that file?
Edit: I missed that you are using HABPanel, please show the definition of the widget that is supposed to show the items.
Using habpanel
The switches that did work no longer have an item linked and the item I need is no longer there. For what ever reason the item file is not being seen
2018-06-30 22:03:59.722 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘Sonoff.items’ has errors, therefore ignoring it: [9,17]: missing EOF at ‘�’
2018-06-30 22:08:44.508 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘Sonoff.items’ has errors, therefore ignoring it: [9,17]: missing EOF at ‘�’
I have removed the \T1 items and the basic devices have returned. So something wrong with formatting of t1 section
Sorry, I guess you did a copy&paste… there was a typo, because I also did a copy&paste and forgot to correct the quotes.
“” vs ""
and
‘’ vs ''
This is due to the fact, that discourse (the forum software) does an automatic change to text if not quoted as code.
I changed the code in my original posting.
Sorry but i’m very new to this, cant see the difference and i’m not sure what you mean. I just pasted the code again and got the same problem
Should I use " or ’
The double quotes " " should only be the vertical ones, NOT the ones tilted towards the including text!
Now visible as items
Thanks guys. very much appreciated.
James
i have Tasmota firmware flashed on my sonoff devices
Switch SonoffGardena "Sprinkler" { http=">[ON:POST:http://192.168.1.131/cm?user=admin&password=password&cmnd=Power%%20ON] >[OFF:POST:http://192.168.1.131/cm?user=admin&password=password&cmnd=Power%%20OFF]" }
String SonoffGardenaGV "Sonoff GetValue" { http="<[http://192.168.1.131/cm?user=admin&password=password&cmnd=Power:60000:REGEX(.*?\\{\"POWER\":\"(.*?)\"\\}.*)]"}
With installing a mqtt broker it is easier and more reliable than http…