Jest to jedno z najbardziej niepozornych urządzeń jakie sobie kupiłem! To ile jest możliwości - wykorzystania tej kostki do sterowania smart home przyprawia o ból głowy :D
Osobiście jedną kostką steruję: dwiema żarówkami (w tym ściemnianiem) i to niezależnie, głośnością mediów, sterowanie: następna, poprzednia piosenka oraz pauza a to jeszcze nic... Mamy dosłownie kilkadziesiąt kombinacji!
Na początku muszę poinformować, że urządzenie łączyłem z Home Assistant - Zigbee2mqtt (CC2531 za 4$) a więc nie wykorzystywałem bramki od Xiaomi (Aqara). Magic Cube możecie kupić na Aliexpress za ok 11$ i uważam, że jest warta każdego wydanego na nią centa!
Dlaczego Zigbee?
Przeczytaj ten artykuł aby poznać zalety i możliwości tego standardu: Zigbee - jaką bramkę wybrać? Ogromne możliwości zamknięte standardy.
Specyfikacja
- Wymiary: 45x45x45 mm
- Bateria: CR2450
- Żywotność: 2 lata na jednej baterii
- Protokół komunikacji: Zigbee
Sposób działania
W podstawowym podłączeniu mamy do dyspozycji: shake, wakeup, fall, tap, slide, flip180, flip90, rotate_left
and rotate_right
tylko, że po podłączeniu do Zigbee2MQTT okazuje się, że możliwości jest jeszcze więcej - tak dużo, ze aż warto strony podpisać sobie piktogramami.
Ale zaraz, o co chodzi?
Zigbee2MQTT potrafi odczytać na jakim boku jest kostka!
Bartek wspominał nawet, że odczytuje też from_side
i to_side
ale to sobie już darowałem ;) Jak to wykorzystać?
Jak widzicie robiąc piktogramy na każdym boku możemy w zależności od tego co jest u góry sterować daną funkcją.
Automatyzacje NodeRED
Ja wstępnie ograniczyłem się do 4 funkcji i wygląda to u mnie następująco.
Tutaj gotowiec do pobrania. Dajcie znać w komentarzach jak wy zrobiliście te warunki i do czego wykorzystujecie swoje kostki!
[
{
"id": "af1b8cf9.a00a9",
"type": "server-state-changed",
"z": "b7da7243.f89ef",
"name": "Kostka L",
"server": "b3e9b226.7fd0c",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.0x00158d00042dd474_action",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "rotate_left",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 140,
"y": 1300,
"wires": [
[
"5dd03b90.f92044",
"82483fdd.957c6",
"821a5628.4040c8",
"1ab2f806.3bc788"
],
[]
]
},
{
"id": "d51a48f3.382208",
"type": "server-state-changed",
"z": "b7da7243.f89ef",
"name": "Kostka R",
"server": "b3e9b226.7fd0c",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.0x00158d00042dd474_action",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "rotate_right",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 140,
"y": 1500,
"wires": [
[
"d24e3fb2.afb36",
"1db74e78.015582",
"21f3c752.590bb8",
"e8902e95.5ae36"
],
[]
]
},
{
"id": "99ead837.d54278",
"type": "server-state-changed",
"z": "b7da7243.f89ef",
"name": "Kostka Slide",
"server": "b3e9b226.7fd0c",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.0x00158d00042dd474_action",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "slide",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 150,
"y": 1560,
"wires": [
[],
[]
]
},
{
"id": "8283be08.59ffb",
"type": "server-state-changed",
"z": "b7da7243.f89ef",
"name": "Kostka Tap",
"server": "b3e9b226.7fd0c",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.0x00158d00042dd474_action",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "tap",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 140,
"y": 1620,
"wires": [
[],
[]
]
},
{
"id": "8f5676c.7cb9c88",
"type": "server-state-changed",
"z": "b7da7243.f89ef",
"name": "Kostka Shake",
"server": "b3e9b226.7fd0c",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.0x00158d00042dd474_action",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "shake",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 150,
"y": 1680,
"wires": [
[],
[]
]
},
{
"id": "5dd03b90.f92044",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 0",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "0",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 370,
"y": 1180,
"wires": [
[
"8cd31846.580878"
],
[]
]
},
{
"id": "d24e3fb2.afb36",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 0",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "0",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 350,
"y": 1500,
"wires": [
[
"970c58e7.cd8698"
],
[]
]
},
{
"id": "8cd31846.580878",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "Greg Light brightness",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.0xccccccfffef3966b_light",
"data": "{\"brightness_step_pct\":\"-10\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 600,
"y": 1180,
"wires": [
[]
]
},
{
"id": "970c58e7.cd8698",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "Greg Light brightness +",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.0xccccccfffef3966b_light",
"data": "{\"brightness_step_pct\":\"10\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 610,
"y": 1500,
"wires": [
[]
]
},
{
"id": "82483fdd.957c6",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 1",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "1",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 370,
"y": 1240,
"wires": [
[
"25787ecf.f09a52"
],
[]
]
},
{
"id": "25787ecf.f09a52",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "Kate Light brightness",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.0x680ae2fffe13fcb7_light",
"data": "{\"brightness_step_pct\":\"-10\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 600,
"y": 1240,
"wires": [
[]
]
},
{
"id": "1db74e78.015582",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 1",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "1",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 350,
"y": 1560,
"wires": [
[
"7df69212.ca8e1c"
],
[]
]
},
{
"id": "7df69212.ca8e1c",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "Kate Light brightness +",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.0x680ae2fffe13fcb7_light",
"data": "{\"brightness_step_pct\":\"10\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 610,
"y": 1560,
"wires": [
[]
]
},
{
"id": "eb5ca30d.33d3",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "JBL Vol down",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "media_player",
"service": "volume_down",
"entityId": "media_player.jbl_mobile",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 580,
"y": 1300,
"wires": [
[]
]
},
{
"id": "821a5628.4040c8",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 3",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "3",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 370,
"y": 1300,
"wires": [
[
"eb5ca30d.33d3"
],
[]
]
},
{
"id": "21f3c752.590bb8",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 3",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "3",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 350,
"y": 1620,
"wires": [
[
"68ba2d4.6e851d4"
],
[]
]
},
{
"id": "68ba2d4.6e851d4",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "JBL Vol up",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "media_player",
"service": "volume_up",
"entityId": "media_player.jbl_mobile",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 570,
"y": 1620,
"wires": [
[]
]
},
{
"id": "1ab2f806.3bc788",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 4",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "4",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 370,
"y": 1360,
"wires": [
[
"51e02c6.104c5d4"
],
[]
]
},
{
"id": "51e02c6.104c5d4",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "JBL play/pause",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "media_player",
"service": "media_play_pause",
"entityId": "media_player.jbl_mobile",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 580,
"y": 1360,
"wires": [
[]
]
},
{
"id": "82c05e31.dfe3c",
"type": "api-call-service",
"z": "b7da7243.f89ef",
"name": "JBL next",
"server": "b3e9b226.7fd0c",
"version": 1,
"debugenabled": false,
"service_domain": "media_player",
"service": "media_next_track",
"entityId": "media_player.jbl_mobile",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 560,
"y": 1680,
"wires": [
[]
]
},
{
"id": "e8902e95.5ae36",
"type": "api-current-state",
"z": "b7da7243.f89ef",
"name": "Side 4",
"server": "b3e9b226.7fd0c",
"version": 1,
"outputs": 2,
"halt_if": "4",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.kostka_side",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 350,
"y": 1680,
"wires": [
[
"82c05e31.dfe3c"
],
[]
]
}
]
Oczywiście wcześniej musiałem sobie wyjąć side:
sensor:
- platform: template
sensors:
kostka_side:
friendly_name: "Kostka Side"
value_template: "{{ state_attr('sensor.0x00158d00042dd474_action', 'side') }}"
Problemy z parowaniem
Miałem jakiś problem z parowaniem kostki, czytałem o tym już na blogach ale zamiast kombinować - podczas podłączania cały czas nią coś róbcie jak to nie zadziała to w czasie parowania klikajcie przyciskiem (aby sparować trzymamy przycisk aż zamiga a następnie nim klikamy aby co chwilę wysyłała sygnał) to u mnie sprawdziło się najlepiej.
Podsumowanie
Jak widzicie test tego urządzenia nie zajął dużo stron tekstu - bo to urządzenie jest banalne w obsłudze i po prostu działa i to jak działa - ja jestem mega zadowolony z zakupu! Gdybym chciał do każdego urządzenia osobny pilot zapłaciłbym majątek a tak? Mam jedną kostkę imogę sterować wszystkim na raz!
ps. macie jakiś dobry pomysł jak nałożyć piktogramy? Myślałem o wydrukowaniu na drukarce 3D wzoru a następnie potraktować to sprayem w kolorze złota.
Chcesz wiedzieć więcej? Dołącz do naszej grupy na FB - będzie nam też miło jak polubisz nasz Fanpage!
Dziwi brak reklam? Przeczytaj dlaczego i wesprzyj projekt na lub