Skip to content

Commit

Permalink
Remove own devices prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
misery committed May 23, 2021
1 parent 2e077eb commit 2a754de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ The EnergyLogic provide some system information and information about any wirele
...
devices/G0/name: LivingRoom
devices/G0/RaumTemp: 22.55
devices/G0/SollTemp: 23.00
G0/name: LivingRoom
G0/RaumTemp: 22.55
G0/SollTemp: 23.00
...
devices/G1/name: Kitchen
devices/G1/RaumTemp: 21.35
devices/G1/SollTemp: 21.00
G1/name: Kitchen
G1/RaumTemp: 21.35
G1/SollTemp: 21.00
```

### Set values
The following room values are settable and will be propagated to the EnergyLogic.
Be aware that ``Gx`` needs a valid room number like ``G0``, ``G1`` and so on.

- ``name`` settable via ``devices/Gx/set/name``. This changes the room name.
- ``SollTemp`` settable via ``devices/Gx/set/SollTemp``. This changes the target temperature.
- ``OPMode`` settable via ``devices/Gx/set/OPMode``. This changes heating mode for this device.
- ``name`` settable via ``Gx/set/name``. This changes the room name.
- ``SollTemp`` settable via ``Gx/set/SollTemp``. This changes the target temperature.
- ``OPMode`` settable via ``Gx/set/OPMode``. This changes heating mode for this device.
- ``0`` Day (normally **On**)
- ``1`` Night
- ``2`` Holiday (normally **Off**)
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func refreshRoomInformation(bridge *bridgeCfg, number string) {

for i := 0; i < len(c.Entries); i++ {
name := strings.Replace(c.Entries[i].Name, ".", "/", -1)
t := fmt.Sprint(bridge.Topic, "/devices/", name)
t := fmt.Sprint(bridge.Topic, name)
value := fetchTemperature(name, c.Entries[i].Value)
publish(bridge, t, value)
}
Expand All @@ -232,7 +232,7 @@ func refresh(bridge *bridgeCfg) {
prefix := fmt.Sprint("G", i)
log.Println("Add room:", prefix)
for _, name := range roomSetFields {
topic := fmt.Sprint(bridge.Topic, "/devices/", prefix, "/set/", name)
topic := fmt.Sprint(bridge.Topic, prefix, "/set/", name)
listen(bridge, topic)
}
}
Expand All @@ -244,7 +244,7 @@ func refresh(bridge *bridgeCfg) {
prefix := fmt.Sprint("G", i)
log.Println("Remove room:", prefix)
for _, name := range roomSetFields {
topic := fmt.Sprint(bridge.Topic, "/devices/", prefix, "/set/", name)
topic := fmt.Sprint(bridge.Topic, prefix, "/set/", name)
bridge.Client.Unsubscribe(topic)
}
}
Expand Down

0 comments on commit 2a754de

Please sign in to comment.