Skip to content

Commit d876418

Browse files
authored
Merge pull request #137 from plugwise/mac_uniq
Restore uniqueness of mac-addresses
2 parents 371aa8e + 5800032 commit d876418

File tree

64 files changed

+535
-326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+535
-326
lines changed

.github/workflows/merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest release
55

66
env:
7-
CACHE_VERSION: 4
7+
CACHE_VERSION: 5
88
DEFAULT_PYTHON: 3.9
99

1010
# Only run on merges

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 4
7+
CACHE_VERSION: 5
88
DEFAULT_PYTHON: "3.9"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ tests/__pycache__
1313
venv
1414
fixtures/*
1515
!fixtures/.keep
16+
*.sedbck

CHANGELOG.md

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

3+
- ongoing
4+
- Changed mac-addresses in userdata/fixtures to be obfuscated but unique
5+
36
# v0.16.2 - Generic and Stretch
47
- As per Core deprecation of python 3.8, removed CI/CD testing and bumped pypi to 3.9 and production
58
- Add support for Stretch with fw 2.7.18

scripts/pre-commit.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/usr/bin/env bash
2-
grep -r --include="*.xml" '<mac_address>' userdata/* | grep -v '0123456789AB' && echo "COMMIT REJECTED, found a mac-address, modify domain_objects and modules and set mac-address to 0123456789AB!" && exit 1
32
grep -r --include="*.xml" '<short_id>' userdata/* | grep -v 'abcdefgh' && echo "COMMIT REJECTED, found a real short_id, modify domain_objects and set short_id to abcdefgh!" && exit 1
4-
grep -r --include="*.xml" '<wifi_ip>' userdata/* | grep -v '_ip></wifi' | grep -v '127.0.0.1' && echo "COMMIT REJECTED, found a WIFI ip address, modify domain_objects and set wifi_ip to 127.0.0.1!" && exit 1
5-
grep -r --include="*.xml" 'lan_ip>' userdata/* | grep -v '_ip></lan' | grep -v '127.0.0.1' && echo "COMMIT REJECTED, found a LAN ip address, modify domain_objects and set lan_ip to 127.0.0.1!" && exit 1
6-
grep -Er --include="*.xml" "([0-9]{1,3}[\.]){3}[0-9]{1,3}" userdata/* | grep -Ev '127.0.0.1|0.0.0.0' && echo "COMMIT REJECTED, found ip addresses in the logging, modify domain_objects and set them to 127.0.0.1!" && exit 1
3+
grep -r --include="*.xml" '<wifi_ip>' userdata/* | grep -v '_ip></wifi' | grep -v '127.0.0.' && echo "COMMIT REJECTED, found a WIFI ip address, modify domain_objects and set wifi_ip to 127.0.0.1!" && exit 1
4+
grep -r --include="*.xml" 'lan_ip>' userdata/* | grep -v '_ip></lan' | grep -v '127.0.0.' && echo "COMMIT REJECTED, found a LAN ip address, modify domain_objects and set lan_ip to 127.0.0.1!" && exit 1
5+
grep -Er --include="*.xml" "([0-9]{1,3}[\.]){3}[0-9]{1,3}" userdata/* | grep -Ev '127.0.0.|0.0.0.0' && echo "COMMIT REJECTED, found ip addresses in the logging, modify domain_objects and set them to 127.0.0.1!" && exit 1
76
grep -r --include="*.xml" '<hostname>' userdata/* | grep -v 'smile000000' | grep -v 'stretch000000' && echo "COMMIT REJECTED, found a Smile(/Stretch) hostname, modify system_status or domain_objects and set hostname to smile000000!" && exit 1
87
grep -r --include="*.xml" '<longitude>' userdata/* | grep -v '4.49' && echo "COMMIT REJECTED, found your hometown, modify domain_objects and set longitude to 4.49 (that is: Plugwise HQ)!" && exit 1
98
grep -r --include="*.xml" '<latitude>' userdata/* | grep -v '52.21' && echo "COMMIT REJECTED, found your hometown, modify domain_objects and set latitude to 52.21 (that is: Plugwise HQ)!" && exit 1
109
grep -r --include="*.xml" '<city>' userdata/* | grep -v 'Sassenheim' && echo "COMMIT REJECTED, found your hometown, modify domain_objects and set city to Sassenheim (that is: Plugwise HQ)!" && exit 1
1110
grep -r --include="*.xml" '<postal_code>' userdata/* | grep -v '2171' && echo "COMMIT REJECTED, found your hometown, modify domain_objects and set postal_code to 2171 (that is: Plugwise HQ)!" && exit 1
12-
grep -r --include="*.xml" '<mac>' userdata/* | grep -v '01:23:45:67:89:AB' && echo "COMMIT REJECTED, found a mac-address, modify system_status and set mac-address to 0123456789AB!" && exit 1
1311
# No problems found
1412
exit 0

userdata/README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,32 @@ Don't commit test-data in `tests` that shouldn't be available to 'the internet'.
4848
To prevent this we've included a pre-commit hook that checks and validates that no private information is there (but do double-check yourselves!)
4949
See 'pre-commit.sh' for details
5050

51-
Excerpt:
51+
### Excerpt:
5252

53-
- [ ] modify `domain_objects` and `modules` and set all occurrences of `mac-address` to `0123456789AB`
5453
- [ ] modify `domain_objects` and set `short_id` to `abcdefgh`
55-
- [ ] modify `domain_objects` and set `wifi_ip` to `127.0.0.1`
54+
- [ ] modify `domain_objects` and set `wifi_ip` to `127.0.0.2`
5655
- [ ] modify `domain_objects` and set `lan_ip` to `127.0.0.1`
57-
- [ ] modify `domain_objects` and set all `ip_addresses` to `127.0.0.1`
56+
- [ ] modify `domain_objects` and set all `ip_addresses` to `127.0.0.3`
5857
- [ ] modify `domain_objects` and set `hostname` to `smile000000`
5958
- [ ] modify `domain_objects` and set `longitude` to `4.49`
6059
- [ ] modify `domain_objects` and set `latitude` to `52.21`
6160
- [ ] modify `domain_objects` and set `city` to `Sassenheim`
6261
- [ ] modify `domain_objects` and set `postal_code` to `2171`
62+
63+
### Obfuscating mac-addresses
64+
65+
We used to obfuscate them as they weren't used within our module nor HomeAssistant.
66+
With 0.16.4 this was changed as such we recommend leaving them in, if you do wish to obfuscate
67+
68+
Prefix:
69+
70+
- `01234567`
71+
72+
Postfix:
73+
74+
- Anything you'd normally have (last 4 digits can remain)
75+
- When standardizing:
76+
- 0001 = Network Mac Address
77+
- 0101 = Controller Zigbee Mac Address
78+
- 0Axx = Nodes Zigbee mac addresses
79+

userdata/adam_heatpump/appliances.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@
14461446
<interval/>
14471447
<network_address id='f33dd0b1873646128e89c28b7f3325b6'/>
14481448
<period start_date="2021-12-24T15:23:49+01:00" end_date="2021-12-24T15:23:49+01:00">
1449-
<measurement log_date="2021-12-24T15:23:49+01:00">127.0.0.1</measurement>
1449+
<measurement log_date="2021-12-24T15:23:49+01:00">127.0.0.2</measurement>
14501450
</period>
14511451
</point_log>
14521452
<point_log id='b25164d984a740cb8bb6da790ba5d2f4'>

userdata/adam_heatpump/domain_objects.xml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
</services>
147147
<protocols>
148148
<zig_bee_node id='138298657dbd44ca9b8393b6a3cd86a8'>
149-
<mac_address>0123456789AB</mac_address>
149+
<mac_address>012345670A01</mac_address>
150150
<type>router</type>
151151
<reachable>true</reachable>
152152
<power_source>mains</power_source>
@@ -386,7 +386,7 @@
386386
</services>
387387
<protocols>
388388
<zig_bee_node id='9a0d6157588a43c9ae492a362cb71168'>
389-
<mac_address>0123456789AB</mac_address>
389+
<mac_address>012345670A02</mac_address>
390390
<type>end_device</type>
391391
<reachable>true</reachable>
392392
<power_source>battery</power_source>
@@ -729,7 +729,7 @@
729729
</services>
730730
<protocols>
731731
<zig_bee_node id='33e54459fdd54c22b3b99ae70a94d1c5'>
732-
<mac_address>0123456789AB</mac_address>
732+
<mac_address>012345670A03</mac_address>
733733
<type>router</type>
734734
<reachable>true</reachable>
735735
<power_source>mains</power_source>
@@ -931,7 +931,7 @@
931931
</services>
932932
<protocols>
933933
<zig_bee_node id='4ac495040ae2462d832b15d00b245c0b'>
934-
<mac_address>0123456789AB</mac_address>
934+
<mac_address>012345670A04</mac_address>
935935
<type>router</type>
936936
<reachable>true</reachable>
937937
<power_source>mains</power_source>
@@ -1266,7 +1266,7 @@
12661266
</services>
12671267
<protocols>
12681268
<zig_bee_node id='8dbb5981239a41d1b7c39c6a85276c61'>
1269-
<mac_address>0123456789AB</mac_address>
1269+
<mac_address>012345670A05</mac_address>
12701270
<type>router</type>
12711271
<reachable>true</reachable>
12721272
<power_source>mains</power_source>
@@ -1347,7 +1347,7 @@
13471347
</services>
13481348
<protocols>
13491349
<zig_bee_node id='a64db02a2fa243e0a9c00126ad1b1f7e'>
1350-
<mac_address>0123456789AB</mac_address>
1350+
<mac_address>012345670A06</mac_address>
13511351
<type>router</type>
13521352
<reachable>true</reachable>
13531353
<power_source>mains</power_source>
@@ -1378,7 +1378,7 @@
13781378
</services>
13791379
<protocols>
13801380
<zig_bee_node id='972269fa494440d393dbdb8e5b0643b7'>
1381-
<mac_address>0123456789AB</mac_address>
1381+
<mac_address>012345670A07</mac_address>
13821382
<type>router</type>
13831383
<reachable>true</reachable>
13841384
<power_source>mains</power_source>
@@ -2347,7 +2347,7 @@
23472347
</services>
23482348
<protocols>
23492349
<zig_bee_node id='ede18329ad24437d8d37222733789c7c'>
2350-
<mac_address>0123456789AB</mac_address>
2350+
<mac_address>012345670A08</mac_address>
23512351
<type>router</type>
23522352
<reachable>true</reachable>
23532353
<power_source>mains</power_source>
@@ -2403,7 +2403,7 @@
24032403
<interval/>
24042404
<network_address id='f33dd0b1873646128e89c28b7f3325b6'/>
24052405
<period start_date="2021-12-24T15:23:49+01:00" end_date="2021-12-24T15:23:49+01:00">
2406-
<measurement log_date="2021-12-24T15:23:49+01:00">127.0.0.1</measurement>
2406+
<measurement log_date="2021-12-24T15:23:49+01:00">127.0.0.2</measurement>
24072407
</period>
24082408
</point_log>
24092409
<point_log id='b25164d984a740cb8bb6da790ba5d2f4'>
@@ -2644,11 +2644,11 @@
26442644
<vendor_model>smile_open_therm</vendor_model>
26452645
<hardware_version>AME Smile 2.0 board</hardware_version>
26462646
<firmware_version>3.2.8</firmware_version>
2647-
<mac_address>0123456789AB</mac_address>
2647+
<mac_address>012345670001</mac_address>
26482648
<short_id>abcdefgh</short_id>
26492649
<send_data>true</send_data>
26502650
<anonymous>false</anonymous>
2651-
<lan_ip>127.0.0.1</lan_ip>
2651+
<lan_ip>127.0.0.2</lan_ip>
26522652
<wifi_ip></wifi_ip>
26532653
<hostname>smile000000</hostname>
26542654
<time>2021-12-31T13:48:55+01:00</time>
@@ -3355,7 +3355,7 @@
33553355
</services>
33563356
<protocols>
33573357
<zig_bee_node id='b1d09b4fa20c4f1a98278709b3363eea'>
3358-
<mac_address>0123456789AB</mac_address>
3358+
<mac_address>012345670A09</mac_address>
33593359
<type>router</type>
33603360
<reachable>true</reachable>
33613361
<power_source>mains</power_source>
@@ -3386,7 +3386,7 @@
33863386
</services>
33873387
<protocols>
33883388
<zig_bee_node id='5cf439ab62eb48c3977ca41ac1d986ee'>
3389-
<mac_address>0123456789AB</mac_address>
3389+
<mac_address>012345670A10</mac_address>
33903390
<type>router</type>
33913391
<reachable>true</reachable>
33923392
<power_source>mains</power_source>
@@ -3567,7 +3567,7 @@
35673567
</services>
35683568
<protocols>
35693569
<zig_bee_node id='91af9b4eb6b247909afab2b09cca821a'>
3570-
<mac_address>0123456789AB</mac_address>
3570+
<mac_address>012345670A11</mac_address>
35713571
<type>router</type>
35723572
<reachable>true</reachable>
35733573
<power_source>mains</power_source>
@@ -3598,7 +3598,7 @@
35983598
</services>
35993599
<protocols>
36003600
<zig_bee_node id='59277b278b4c48a3889cd70378299ebb'>
3601-
<mac_address>0123456789AB</mac_address>
3601+
<mac_address>012345670A12</mac_address>
36023602
<type>router</type>
36033603
<reachable>true</reachable>
36043604
<power_source>mains</power_source>
@@ -3629,7 +3629,7 @@
36293629
</services>
36303630
<protocols>
36313631
<zig_bee_node id='08ceb19506ee4546998f62381e867a8e'>
3632-
<mac_address>0123456789AB</mac_address>
3632+
<mac_address>012345670A13</mac_address>
36333633
<type>router</type>
36343634
<reachable>true</reachable>
36353635
<power_source>mains</power_source>
@@ -3660,7 +3660,7 @@
36603660
</services>
36613661
<protocols>
36623662
<zig_bee_node id='954e187dd4924e6a92a109f41d844712'>
3663-
<mac_address>0123456789AB</mac_address>
3663+
<mac_address>012345670A14</mac_address>
36643664
<type>router</type>
36653665
<reachable>true</reachable>
36663666
<power_source>mains</power_source>
@@ -3691,7 +3691,7 @@
36913691
</services>
36923692
<protocols>
36933693
<zig_bee_node id='e116d86377504e69bc8efb73988f11f8'>
3694-
<mac_address>0123456789AB</mac_address>
3694+
<mac_address>012345670A15</mac_address>
36953695
<type>router</type>
36963696
<reachable>true</reachable>
36973697
<power_source>mains</power_source>
@@ -3805,7 +3805,7 @@
38053805
</services>
38063806
<protocols>
38073807
<zig_bee_node id='8f06059e0cdc44038e9201fd8bfbea97'>
3808-
<mac_address>0123456789AB</mac_address>
3808+
<mac_address>012345670A16</mac_address>
38093809
<type>router</type>
38103810
<reachable>true</reachable>
38113811
<power_source>mains</power_source>
@@ -3881,7 +3881,7 @@
38813881
</services>
38823882
<protocols>
38833883
<zig_bee_node id='96ce5e59e0474853bda4ee2794ed0da0'>
3884-
<mac_address>0123456789AB</mac_address>
3884+
<mac_address>012345670A17</mac_address>
38853885
<type>end_device</type>
38863886
<reachable>true</reachable>
38873887
<power_source>battery</power_source>
@@ -3912,7 +3912,7 @@
39123912
</services>
39133913
<protocols>
39143914
<zig_bee_node id='29f51d5cde66420facb975744d59f09c'>
3915-
<mac_address>0123456789AB</mac_address>
3915+
<mac_address>012345670A18</mac_address>
39163916
<type>router</type>
39173917
<reachable>true</reachable>
39183918
<power_source>mains</power_source>
@@ -3932,7 +3932,7 @@
39323932
<services/>
39333933
<protocols>
39343934
<zig_bee_coordinator id='d55765aedfdf47baa1e3cc6d2b2d6000'>
3935-
<mac_address>0123456789AB</mac_address>
3935+
<mac_address>012345670101</mac_address>
39363936
<permit_joining>false</permit_joining>
39373937
<neighbors><zig_bee_node id='4ac495040ae2462d832b15d00b245c0b'/><zig_bee_node id='8dbb5981239a41d1b7c39c6a85276c61'/><zig_bee_node id='91af9b4eb6b247909afab2b09cca821a'/><zig_bee_node id='972269fa494440d393dbdb8e5b0643b7'/><zig_bee_node id='c2f3ab78380a4ff3a1fbdd7638a67099'/><zig_bee_node id='ede18329ad24437d8d37222733789c7c'/></neighbors>
39383938
<zig_bee_nodes><zig_bee_node id='08ceb19506ee4546998f62381e867a8e'/><zig_bee_node id='0a85fd64b82246fbaac0a5c6e77ae958'/><zig_bee_node id='138298657dbd44ca9b8393b6a3cd86a8'/><zig_bee_node id='29f51d5cde66420facb975744d59f09c'/><zig_bee_node id='33e54459fdd54c22b3b99ae70a94d1c5'/><zig_bee_node id='4ac495040ae2462d832b15d00b245c0b'/><zig_bee_node id='59277b278b4c48a3889cd70378299ebb'/><zig_bee_node id='5cf439ab62eb48c3977ca41ac1d986ee'/><zig_bee_node id='8dbb5981239a41d1b7c39c6a85276c61'/><zig_bee_node id='8f06059e0cdc44038e9201fd8bfbea97'/><zig_bee_node id='91af9b4eb6b247909afab2b09cca821a'/><zig_bee_node id='954e187dd4924e6a92a109f41d844712'/><zig_bee_node id='96ce5e59e0474853bda4ee2794ed0da0'/><zig_bee_node id='972269fa494440d393dbdb8e5b0643b7'/><zig_bee_node id='9a0d6157588a43c9ae492a362cb71168'/><zig_bee_node id='a64db02a2fa243e0a9c00126ad1b1f7e'/><zig_bee_node id='b1d09b4fa20c4f1a98278709b3363eea'/><zig_bee_node id='c2f3ab78380a4ff3a1fbdd7638a67099'/><zig_bee_node id='e116d86377504e69bc8efb73988f11f8'/><zig_bee_node id='ede18329ad24437d8d37222733789c7c'/></zig_bee_nodes>
@@ -4108,7 +4108,7 @@
41084108
</services>
41094109
<protocols>
41104110
<zig_bee_node id='0a85fd64b82246fbaac0a5c6e77ae958'>
4111-
<mac_address>0123456789AB</mac_address>
4111+
<mac_address>012345670A19</mac_address>
41124112
<type>router</type>
41134113
<reachable>false</reachable>
41144114
<power_source>mains</power_source>
@@ -4139,7 +4139,7 @@
41394139
</services>
41404140
<protocols>
41414141
<zig_bee_node id='c2f3ab78380a4ff3a1fbdd7638a67099'>
4142-
<mac_address>0123456789AB</mac_address>
4142+
<mac_address>012345670A20</mac_address>
41434143
<type>router</type>
41444144
<reachable>true</reachable>
41454145
<power_source>mains</power_source>

0 commit comments

Comments
 (0)