Re: shelly 2 openhab Einbindung per MQTT
Verfasst: 12. Apr 2019 23:31
ja, ist er
Code: Alles auswählen
// Fenster
Thing topic shellies "Fenster" @ "WZ"{
Channels:
Type rollershutter : shellyswitch25-745919 "Fenster 3" [ stateTopic="shellies/shellyswitch25-745919/roller/0" , commandTopic="shellies/shellyswitch25-745919/roller/0/command" , transformationPattern="MAP:shelly.map"]
// Type number : temperature "Temperatur" [ stateTopic="shellies/shellyswitch25-745919/temperature" ]
Type rollershutter : shellyswitch25-744E5F "Fenster 2" [ stateTopic="shellies/shellyswitch25-744E5F/roller/0" , commandTopic="shellies/shellyswitch25-744E5F/roller/0/command" , transformationPattern="MAP:shelly.map"]
Type rollershutter : shellyswitch25-745897 "Fenster 1" [ stateTopic="shellies/shellyswitch25-745897/roller/0" , commandTopic="shellies/shellyswitch25-745897/roller/0/command" , transformationPattern="MAP:shelly.map"]
}
Code: Alles auswählen
Rollershutter Fenster_3 "Fenster 3" [ "Switchable" ] {channel="mqtt:topic:abhome:shellies:shellyswitch25-745919"}
Rollershutter Fenster_2 "Fenster 2" [ "Switchable" ] {channel="mqtt:topic:abhome:shellies:shellyswitch25-744E5F"}
Rollershutter Fenster_1 "Fenster 1" [ "Switchable" ] {channel="mqtt:topic:abhome:shellies:shellyswitch25-745897"}
Code: Alles auswählen
UP=up
DOWN=down
STOP=stop
0=close
100=open
open=0
close=100
=stop
Code: Alles auswählen
rule "Fenster 3"
when
Item Fenster_3 received command
then
val mqttActions = getActions("mqtt","mqtt:broker:abhome")
if(Fenster_3.state.toString == "100") {
mqttActions.publishMQTT("shellies/shellyswitch25-745919/roller/0/command","close")
}
else if (Fenster_3.state.toString == "0") {
mqttActions.publishMQTT("shellies/shellyswitch25-745919/roller/0/command","open")
}
if (receivedCommand == STOP){
mqttActions.publishMQTT("shellies/shellyswitch25-745919/roller/0/command","stop")
}
end
rule "Fenster 2"
when
Item Fenster_2 received command
then
val mqttActions = getActions("mqtt","mqtt:broker:abhome")
if(Fenster_2.state.toString == "100") {
mqttActions.publishMQTT("shellies/shellyswitch25-744E5F/roller/0/command","close")
}
else if (Fenster_2.state.toString == "0") {
mqttActions.publishMQTT("shellies/shellyswitch25-744E5F/roller/0/command","open")
}
if (receivedCommand == STOP){
mqttActions.publishMQTT("shellies/shellyswitch25-744E5F/roller/0/command","stop")
}
end
rule "Fenster 1"
when
Item Fenster_1 received command
then
val mqttActions = getActions("mqtt","mqtt:broker:abhome")
if(Fenster_1.state.toString == "100") {
mqttActions.publishMQTT("shellies/shellyswitch25-745897/roller/0/command","close")
}
else if (Fenster_1.state.toString == "0") {
mqttActions.publishMQTT("shellies/shellyswitch25-745897/roller/0/command","open")
}
if (receivedCommand == STOP){
mqttActions.publishMQTT("shellies/shellyswitch25-745897/roller/0/command","stop")
}
end
dies kann man mit Alexa und routine realisieren.Peter Aschinger hat geschrieben: ↑24. Apr 2019 23:07 Hallo zusammen,
habe nun endlich auch meine 2.5er Shellys erhalten.
Kann ich diese auch auf eine bestimmte Position fahren ?
Zb. Close auf 70% ?
Das benötigte ich für meine Verschattung.
Vielen Grüße
Peter
oder mit:giss69 hat geschrieben: ↑26. Apr 2019 12:55dies kann man mit Alexa und routine realisieren.Peter Aschinger hat geschrieben: ↑24. Apr 2019 23:07 Hallo zusammen,
habe nun endlich auch meine 2.5er Shellys erhalten.
Kann ich diese auch auf eine bestimmte Position fahren ?
Zb. Close auf 70% ?
Das benötigte ich für meine Verschattung.
Vielen Grüße
Peter
Code: Alles auswählen
Bridge mqtt..........
Type number : Shelly_d "ShellyDimmer" [ commandTopic="shellies/shellyswitch-32B0C4/roller/0/command/pos", stateTopic="shellies/shellyswitch-32B0C4/roller/0/pos" ,min=0, max=100, step=2]
Code: Alles auswählen
Switch icon=blinds item=Shelly_d mappings=[0="close",30="sun",100="open"]
Hallo gissi69,giss69 hat geschrieben: ↑24. Apr 2019 18:02 @winni
ich habe es nicht über paper eingerichtet, sondern mit thing, item, map, rules file
thingsitemCode: Alles auswählen
// Fenster Thing topic shellies "Fenster" @ "WZ"{ Channels: Type rollershutter : shellyswitch25-745919 "Fenster 3" [ stateTopic="shellies/shellyswitch25-745919/roller/0" , commandTopic="shellies/shellyswitch25-745919/roller/0/command" , transformationPattern="MAP:shelly.map"] // Type number : temperature "Temperatur" [ stateTopic="shellies/shellyswitch25-745919/temperature" ] Type rollershutter : shellyswitch25-744E5F "Fenster 2" [ stateTopic="shellies/shellyswitch25-744E5F/roller/0" , commandTopic="shellies/shellyswitch25-744E5F/roller/0/command" , transformationPattern="MAP:shelly.map"] Type rollershutter : shellyswitch25-745897 "Fenster 1" [ stateTopic="shellies/shellyswitch25-745897/roller/0" , commandTopic="shellies/shellyswitch25-745897/roller/0/command" , transformationPattern="MAP:shelly.map"] }
mapCode: Alles auswählen
Rollershutter Fenster_3 "Fenster 3" [ "Switchable" ] {channel="mqtt:topic:abhome:shellies:shellyswitch25-745919"} Rollershutter Fenster_2 "Fenster 2" [ "Switchable" ] {channel="mqtt:topic:abhome:shellies:shellyswitch25-744E5F"} Rollershutter Fenster_1 "Fenster 1" [ "Switchable" ] {channel="mqtt:topic:abhome:shellies:shellyswitch25-745897"}
rulesCode: Alles auswählen
UP=up DOWN=down STOP=stop 0=close 100=open open=0 close=100 =stop
Code: Alles auswählen
rule "Fenster 3" when Item Fenster_3 received command then val mqttActions = getActions("mqtt","mqtt:broker:abhome") if(Fenster_3.state.toString == "100") { mqttActions.publishMQTT("shellies/shellyswitch25-745919/roller/0/command","close") } else if (Fenster_3.state.toString == "0") { mqttActions.publishMQTT("shellies/shellyswitch25-745919/roller/0/command","open") } if (receivedCommand == STOP){ mqttActions.publishMQTT("shellies/shellyswitch25-745919/roller/0/command","stop") } end rule "Fenster 2" when Item Fenster_2 received command then val mqttActions = getActions("mqtt","mqtt:broker:abhome") if(Fenster_2.state.toString == "100") { mqttActions.publishMQTT("shellies/shellyswitch25-744E5F/roller/0/command","close") } else if (Fenster_2.state.toString == "0") { mqttActions.publishMQTT("shellies/shellyswitch25-744E5F/roller/0/command","open") } if (receivedCommand == STOP){ mqttActions.publishMQTT("shellies/shellyswitch25-744E5F/roller/0/command","stop") } end rule "Fenster 1" when Item Fenster_1 received command then val mqttActions = getActions("mqtt","mqtt:broker:abhome") if(Fenster_1.state.toString == "100") { mqttActions.publishMQTT("shellies/shellyswitch25-745897/roller/0/command","close") } else if (Fenster_1.state.toString == "0") { mqttActions.publishMQTT("shellies/shellyswitch25-745897/roller/0/command","open") } if (receivedCommand == STOP){ mqttActions.publishMQTT("shellies/shellyswitch25-745897/roller/0/command","stop") } end
Code: Alles auswählen
2019-04-29 21:26:07.526 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'stop' with the file 'shelly.map' : Target value not found in map for 'stop'