Hi,
I want to draw a chart of the battery levels of my Tradfri remotes. I tried to follow the steps of the Influx and Grafana Tutorial. I could draw the sinus test chart and managed to insert data from (only one?) Tradfri remote. The data is the current battery level (so, a little success). My Problem is:
I think most of the time only the data of one remote gets persisted (and I don’t know of which one). My setting:
The items/groups:
Group gFP_Status "Status" <status> (gFP)
Group gFP_Status_BatteryLevel "Batterieladung" <status> (gFP_Status)
// Remotes
Number Remote_GF_Bedroom_BatteryLevel "Batterieladung" <Battery> (gFP_Status_BatteryLevel) { channel="tradfri:xx:x:xx:battery_level" }
Switch Remote_GF_Bedroom_LowBattery "Niedriger Batteriestatus" <Battery> (gFP_Status_LowBattery) { channel="tradfri:xx:xx:xx:battery_low" }
Number Remote_GF_LivingRoom_BatteryLevel "Batterieladung" <Battery> (gFP_Status_BatteryLevel) { channel="tradfri:xx:xx:xx:battery_level" }
Switch Remote_GF_LivingRoom_LowBattery "Niedriger Batteriestatus" <Battery> (gFP_Status_LowBattery) { channel="tradfri:xx:xx:xx:battery_low" }
Number Remote_GF_Kitchen_BatteryLevel "Batterieladung" <Battery> (gFP_Status_BatteryLevel) { channel="tradfri:xx:xx:xx:battery_level" }
Switch Remote_GF_Kitchen_LowBattery "Niedriger Batteriestatus" <Battery> (gFP_Status_LowBattery) { channel="tradfri:xx:xx:xx:battery_low" }
influxdb.persist (the everyMinute strategy is added in order to get some test data):
// persistence strategies have a name and definition and are referred to in the "Items" section
Strategies {
everyMinute : "0 * * * * ?"
everyFiveMinutes : "0 */5 * ? * *"
everyTenMinutes : "0 */10 * ? * *"
everyFifteenMinutes : "0 */15 * ? * *"
everyHalfHour : "0 */30 * ? * *"
everyHour : "0 0 * * * ?"
everyTwoHours : "0 0 0/2 ? * *"
everyTwelveHours : "0 0 */12 ? * *"
everyDay : "0 0 0 * * ?"
// if no strategy is specified for an Item entry below, the default list will be used
default = everyChange
}
/*
* Each line in this section defines for which Item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* Item (excl. the group Item itself).
*/
Items {
gFP_Status_BatteryLevel* -> "Batterieladung" : strategy = everyChange, everyHour, everyMinute
}
influxdb data (snippet):
> select * from Batterieladung
name: Batterieladung
time value
---- -----
2019-01-01T14:56:00.1Z 87
2019-01-01T14:57:00.111Z 87
2019-01-01T14:58:00.109Z 87
2019-01-01T14:59:00.128Z 87
2019-01-01T15:00:00.105Z 74
2019-01-01T15:00:00.106Z 87
2019-01-01T15:00:00.33Z 87
2019-01-01T15:01:00.181Z 74
2019-01-01T15:01:00.182Z 87
The data show that mostly one remote’s battery level with 87% battery level gets persistet. Sometimes the data from a second one is added, but just every now and then.
What did I miss? How can I add the values of every remote battery level individually and how can I chart them individually and how can I tell which battery level belongs to which remote?
- Platform information:
- Hardware: RP 3b+
- OS: RaspBian stretch
- openHAB version: 2.4
- influxdb 1.7.2
Many thanks in advance and best regards. If you need more information/logs, please tell me.