Skip to content

Commit 67ba9a2

Browse files
authored
Merge pull request #604 from plugwise/bin_sens_battery
Add battery-state binary_sensors, translate battery-low message to a state-change
2 parents c8d9273 + 4efa175 commit 67ba9a2

File tree

19 files changed

+357
-170
lines changed

19 files changed

+357
-170
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.1.0
4+
5+
- New Feature: add a battery_state binary_sensor for battery-powered devices and block the related battery-low notifications.
6+
37
## v1.0.0
48

59
- First formal release to v1.0.0!

fixtures/adam_heatpump_cooling/all_data.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
"Weekend",
4848
"off"
4949
],
50+
"binary_sensors": {
51+
"battery_state": false
52+
},
5053
"control_state": "off",
5154
"dev_class": "zone_thermostat",
5255
"firmware": "2016-10-10T02:00:00+02:00",
@@ -521,6 +524,9 @@
521524
"Weekend",
522525
"off"
523526
],
527+
"binary_sensors": {
528+
"battery_state": false
529+
},
524530
"control_state": "off",
525531
"dev_class": "zone_thermostat",
526532
"firmware": "2016-10-10T02:00:00+02:00",
@@ -632,7 +638,7 @@
632638
"cooling_present": true,
633639
"gateway_id": "7d97fc3117784cfdafe347bcedcbbbcb",
634640
"heater_id": "0ca13e8176204ca7bf6f09de59f81c83",
635-
"item_count": 415,
641+
"item_count": 417,
636642
"notifications": {},
637643
"reboot": true,
638644
"smile_name": "Adam"

fixtures/adam_jip/all_data.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"1346fbd8498d4dbcab7e18d51b771f3d": {
44
"active_preset": "no_frost",
55
"available": true,
6+
"binary_sensors": {
7+
"battery_state": false
8+
},
69
"control_state": "off",
710
"dev_class": "zone_thermostat",
811
"firmware": "2016-10-27T02:00:00+02:00",
@@ -97,6 +100,9 @@
97100
"6f3e9d7084214c21b9dfa46f6eeb8700": {
98101
"active_preset": "home",
99102
"available": true,
103+
"binary_sensors": {
104+
"battery_state": false
105+
},
100106
"control_state": "off",
101107
"dev_class": "zone_thermostat",
102108
"firmware": "2016-10-27T02:00:00+02:00",
@@ -152,6 +158,9 @@
152158
"a6abc6a129ee499c88a4d420cc413b47": {
153159
"active_preset": "home",
154160
"available": true,
161+
"binary_sensors": {
162+
"battery_state": false
163+
},
155164
"control_state": "off",
156165
"dev_class": "zone_thermostat",
157166
"firmware": "2016-10-27T02:00:00+02:00",
@@ -263,6 +272,9 @@
263272
"f61f1a2535f54f52ad006a3d18e459ca": {
264273
"active_preset": "home",
265274
"available": true,
275+
"binary_sensors": {
276+
"battery_state": false
277+
},
266278
"control_state": "off",
267279
"dev_class": "zone_thermometer",
268280
"firmware": "2020-09-01T02:00:00+02:00",
@@ -298,7 +310,7 @@
298310
"cooling_present": false,
299311
"gateway_id": "b5c2386c6f6342669e50fe49dd05b188",
300312
"heater_id": "e4684553153b44afbef2200885f379dc",
301-
"item_count": 213,
313+
"item_count": 217,
302314
"notifications": {},
303315
"reboot": true,
304316
"smile_name": "Adam"

fixtures/adam_multiple_devices_per_zone/all_data.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
},
8383
"680423ff840043738f42cc7f1ff97a36": {
8484
"available": true,
85+
"binary_sensors": {
86+
"battery_state": false
87+
},
8588
"dev_class": "thermo_sensor",
8689
"firmware": "2019-03-27T01:00:00+01:00",
8790
"hardware": "1",
@@ -115,6 +118,9 @@
115118
"CV Jessie",
116119
"off"
117120
],
121+
"binary_sensors": {
122+
"battery_state": false
123+
},
118124
"dev_class": "zone_thermostat",
119125
"firmware": "2016-10-27T02:00:00+02:00",
120126
"hardware": "255",
@@ -199,6 +205,9 @@
199205
},
200206
"a2c3583e0a6349358998b760cea82d2a": {
201207
"available": true,
208+
"binary_sensors": {
209+
"battery_state": false
210+
},
202211
"dev_class": "thermo_sensor",
203212
"firmware": "2019-03-27T01:00:00+01:00",
204213
"hardware": "1",
@@ -255,6 +264,9 @@
255264
"CV Jessie",
256265
"off"
257266
],
267+
"binary_sensors": {
268+
"battery_state": false
269+
},
258270
"dev_class": "zone_thermostat",
259271
"firmware": "2016-08-02T02:00:00+02:00",
260272
"hardware": "255",
@@ -306,6 +318,9 @@
306318
},
307319
"d3da73bde12a47d5a6b8f9dad971f2ec": {
308320
"available": true,
321+
"binary_sensors": {
322+
"battery_state": false
323+
},
309324
"dev_class": "thermo_sensor",
310325
"firmware": "2019-03-27T01:00:00+01:00",
311326
"hardware": "1",
@@ -339,6 +354,9 @@
339354
"CV Jessie",
340355
"off"
341356
],
357+
"binary_sensors": {
358+
"battery_state": false
359+
},
342360
"dev_class": "zone_thermostat",
343361
"firmware": "2016-10-27T02:00:00+02:00",
344362
"hardware": "255",
@@ -379,6 +397,9 @@
379397
"CV Jessie",
380398
"off"
381399
],
400+
"binary_sensors": {
401+
"battery_state": false
402+
},
382403
"dev_class": "thermostatic_radiator_valve",
383404
"firmware": "2019-03-27T01:00:00+01:00",
384405
"hardware": "1",
@@ -421,6 +442,9 @@
421442
"CV Jessie",
422443
"off"
423444
],
445+
"binary_sensors": {
446+
"battery_state": false
447+
},
424448
"dev_class": "zone_thermostat",
425449
"firmware": "2016-10-27T02:00:00+02:00",
426450
"hardware": "255",
@@ -473,7 +497,7 @@
473497
"cooling_present": false,
474498
"gateway_id": "fe799307f1624099878210aa0b9f1475",
475499
"heater_id": "90986d591dcd426cae3ec3e8111ff730",
476-
"item_count": 315,
500+
"item_count": 323,
477501
"notifications": {
478502
"af82e4ccf9c548528166d38e560662a4": {
479503
"warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device."

fixtures/adam_plus_anna_new/all_data.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
},
2828
"1772a4ea304041adb83f357b751341ff": {
2929
"available": true,
30+
"binary_sensors": {
31+
"battery_state": false
32+
},
3033
"dev_class": "thermo_sensor",
3134
"firmware": "2020-11-04T01:00:00+01:00",
3235
"hardware": "1",
@@ -184,6 +187,9 @@
184187
"Weekschema",
185188
"off"
186189
],
190+
"binary_sensors": {
191+
"battery_state": true
192+
},
187193
"control_state": "preheating",
188194
"dev_class": "zone_thermostat",
189195
"firmware": "2016-10-10T02:00:00+02:00",
@@ -195,7 +201,7 @@
195201
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
196202
"select_schedule": "Badkamer",
197203
"sensors": {
198-
"battery": 38,
204+
"battery": 14,
199205
"setpoint": 18.0,
200206
"temperature": 16.5
201207
},
@@ -231,7 +237,7 @@
231237
"cooling_present": false,
232238
"gateway_id": "da224107914542988a88561b4452b0f6",
233239
"heater_id": "056ee145a816487eaa69243c3280f8bf",
234-
"item_count": 147,
240+
"item_count": 149,
235241
"notifications": {},
236242
"reboot": true,
237243
"smile_name": "Adam"

fixtures/adam_zone_per_device/all_data.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
},
8383
"680423ff840043738f42cc7f1ff97a36": {
8484
"available": true,
85+
"binary_sensors": {
86+
"battery_state": false
87+
},
8588
"dev_class": "thermo_sensor",
8689
"firmware": "2019-03-27T01:00:00+01:00",
8790
"hardware": "1",
@@ -115,6 +118,9 @@
115118
"CV Jessie",
116119
"off"
117120
],
121+
"binary_sensors": {
122+
"battery_state": false
123+
},
118124
"dev_class": "zone_thermostat",
119125
"firmware": "2016-10-27T02:00:00+02:00",
120126
"hardware": "255",
@@ -199,6 +205,9 @@
199205
},
200206
"a2c3583e0a6349358998b760cea82d2a": {
201207
"available": true,
208+
"binary_sensors": {
209+
"battery_state": false
210+
},
202211
"dev_class": "thermo_sensor",
203212
"firmware": "2019-03-27T01:00:00+01:00",
204213
"hardware": "1",
@@ -255,6 +264,9 @@
255264
"CV Jessie",
256265
"off"
257266
],
267+
"binary_sensors": {
268+
"battery_state": false
269+
},
258270
"dev_class": "zone_thermostat",
259271
"firmware": "2016-08-02T02:00:00+02:00",
260272
"hardware": "255",
@@ -306,6 +318,9 @@
306318
},
307319
"d3da73bde12a47d5a6b8f9dad971f2ec": {
308320
"available": true,
321+
"binary_sensors": {
322+
"battery_state": false
323+
},
309324
"dev_class": "thermo_sensor",
310325
"firmware": "2019-03-27T01:00:00+01:00",
311326
"hardware": "1",
@@ -339,6 +354,9 @@
339354
"CV Jessie",
340355
"off"
341356
],
357+
"binary_sensors": {
358+
"battery_state": false
359+
},
342360
"dev_class": "zone_thermostat",
343361
"firmware": "2016-10-27T02:00:00+02:00",
344362
"hardware": "255",
@@ -379,6 +397,9 @@
379397
"CV Jessie",
380398
"off"
381399
],
400+
"binary_sensors": {
401+
"battery_state": false
402+
},
382403
"dev_class": "thermostatic_radiator_valve",
383404
"firmware": "2019-03-27T01:00:00+01:00",
384405
"hardware": "1",
@@ -421,6 +442,9 @@
421442
"CV Jessie",
422443
"off"
423444
],
445+
"binary_sensors": {
446+
"battery_state": false
447+
},
424448
"dev_class": "zone_thermostat",
425449
"firmware": "2016-10-27T02:00:00+02:00",
426450
"hardware": "255",
@@ -473,7 +497,7 @@
473497
"cooling_present": false,
474498
"gateway_id": "fe799307f1624099878210aa0b9f1475",
475499
"heater_id": "90986d591dcd426cae3ec3e8111ff730",
476-
"item_count": 315,
500+
"item_count": 323,
477501
"notifications": {
478502
"af82e4ccf9c548528166d38e560662a4": {
479503
"warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device."

fixtures/m_adam_cooling/all_data.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
},
2929
"1772a4ea304041adb83f357b751341ff": {
3030
"available": true,
31+
"binary_sensors": {
32+
"battery_state": false
33+
},
3134
"dev_class": "thermo_sensor",
3235
"firmware": "2020-11-04T01:00:00+01:00",
3336
"hardware": "1",
@@ -116,6 +119,9 @@
116119
"Weekschema",
117120
"off"
118121
],
122+
"binary_sensors": {
123+
"battery_state": true
124+
},
119125
"control_state": "preheating",
120126
"dev_class": "zone_thermostat",
121127
"firmware": "2016-10-10T02:00:00+02:00",
@@ -127,7 +133,7 @@
127133
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
128134
"select_schedule": "Badkamer",
129135
"sensors": {
130-
"battery": 38,
136+
"battery": 14,
131137
"setpoint": 23.5,
132138
"temperature": 23.9
133139
},
@@ -163,7 +169,7 @@
163169
"cooling_present": true,
164170
"gateway_id": "da224107914542988a88561b4452b0f6",
165171
"heater_id": "056ee145a816487eaa69243c3280f8bf",
166-
"item_count": 147,
172+
"item_count": 149,
167173
"notifications": {},
168174
"reboot": true,
169175
"smile_name": "Adam"

fixtures/m_adam_heating/all_data.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
},
3434
"1772a4ea304041adb83f357b751341ff": {
3535
"available": true,
36+
"binary_sensors": {
37+
"battery_state": false
38+
},
3639
"dev_class": "thermo_sensor",
3740
"firmware": "2020-11-04T01:00:00+01:00",
3841
"hardware": "1",
@@ -115,6 +118,9 @@
115118
"Weekschema",
116119
"off"
117120
],
121+
"binary_sensors": {
122+
"battery_state": true
123+
},
118124
"control_state": "off",
119125
"dev_class": "zone_thermostat",
120126
"firmware": "2016-10-10T02:00:00+02:00",
@@ -126,7 +132,7 @@
126132
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
127133
"select_schedule": "Badkamer",
128134
"sensors": {
129-
"battery": 38,
135+
"battery": 14,
130136
"setpoint": 15.0,
131137
"temperature": 17.9
132138
},
@@ -162,7 +168,7 @@
162168
"cooling_present": false,
163169
"gateway_id": "da224107914542988a88561b4452b0f6",
164170
"heater_id": "056ee145a816487eaa69243c3280f8bf",
165-
"item_count": 147,
171+
"item_count": 149,
166172
"notifications": {},
167173
"reboot": true,
168174
"smile_name": "Adam"

0 commit comments

Comments
 (0)