Skip to content

Commit

Permalink
Update items, sitemap and add things
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagogsr committed Jan 2, 2019
1 parent 2b85e8d commit 1e6ad17
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 17 deletions.
20 changes: 16 additions & 4 deletions openhab2/406c.items
@@ -1,8 +1,20 @@
Group Home "406C" <house>

Group Office "Office" <office> (Home)
Group Livingroom "Livingroom" <living> (Home)

Number Office_Temperature "Temperature [%.1f ºC]" <temperature> (Office) {mqtt="<[rpi:home/office/temperature:state:default]"}
Number Office_Humidity "Humidity [%.1f%%]" <humidity> (Office) {mqtt="<[rpi:home/office/humidity:state:default]"}
Switch Livingroom_Light "Livingroom Light" <light> (Livingroom) { channel="mqtt:topic:rpi:livingroomLightTH:PowerSwitch" }
Switch Corridor_Light "Corridor Light" <light> (Livingroom) { channel="mqtt:topic:rpi:corridorLightTH:PowerSwitch" }

Number RPI_Temperature "RPI Temperature [%.1f ºC]" <temperature> (Home) {mqtt="<[rpi:rpi/temperature:state:default]"}
Group Balcony "Balcony" <terrace> (Home)

Group Kitchen "Kitchen" <kitchen> (Home)

Group Laundry "Laundry" <washingmachine> (Home)

Group Suite "Suite" <bedroom> (Home)

Group Office "Office" <office> (Home)

Group GuestRoom "Guest Room" <bedroom> (Home)

Group WC "W.C." <bath> (Home)
9 changes: 0 additions & 9 deletions openhab2/406c.rules
@@ -1,9 +0,0 @@
rule "Send telegram"
when
Item RPI_Temperature changed
then
var temperature = RPI_Temperature.state
if (temperature > 50) {
sendTelegram("406cBot", "A temperatura do RPI está %sºC", temperature.toString)
}
end
29 changes: 25 additions & 4 deletions openhab2/406c.sitemap
@@ -1,6 +1,27 @@
sitemap 406c label="406C" {
Frame {
Text item=RPI_Temperature
Group item=Office
}
Frame label="Livingroom" {
Switch item=Livingroom_Light
Switch item=Corridor_Light
}

Frame label="Balcony" {
}

Frame label="Kitchen" {
}

Frame label="Laundry" {
}

Frame label="Suite" {
}

Frame label="Office" {
}

Frame label="GuestRoom" {
}

Frame label="WC" {
}
}
14 changes: 14 additions & 0 deletions openhab2/406c.things
@@ -0,0 +1,14 @@
Bridge mqtt:bridge:rpi "RPI MQTT Broker" [ host="localhost", secure=false, username="rpi", password="rpi", clientID="rpiMQTTclient" ]
{
Thing topic livingroomLightTH "livingroomLightTH" {
Channels:
Type switch : PowerSwitch [stateTopic="stat/sonoff-6765/POWER1" , transformationPattern="JSONPATH:$.POWER1" , commandTopic="cmnd/sonoff-6765/POWER1", on="ON", off="OFF"]
Type string : Version [stateTopic="stat/sonoff-6765/STATUS2", transformationPattern="JSONPATH:$.StatusFWR.Version"]
}

Thing topic corridorLightTH "corridorLightTH" {
Channels:
Type switch : PowerSwitch [stateTopic="stat/sonoff-6765/POWER2" , transformationPattern="JSONPATH:$.POWER2" , commandTopic="cmnd/sonoff-6765/POWER2", on="ON", off="OFF"]
Type string : Version [stateTopic="stat/sonoff-6765/STATUS2", transformationPattern="JSONPATH:$.StatusFWR.Version"]
}
}

0 comments on commit 1e6ad17

Please sign in to comment.