homebridge-syntex-magichome-fix
v1.2.5-b19
Published
Homebridge Plugin for MagicHome LED Strips with preset scenes
Maintainers
Readme
Homebridge SynTex MagicHome
A simple plugin to control MagicHome devices. This plugin is made to cooperate with Homebridge: https://github.com/nfarina/homebridge It also offers some tweaks and improvements to the original devices.
Core Features
- Device Control: View and control your lights color, saturarion, brightness.
- Scene Support: Use colorful scenes from MagicHome or some custom ones.
- Color Switches: Set the color of your own light groups by value.
- HTTP Access: Update and read device states via HTTP calls.
- Automation: We integrated our powerful automation API for fast and complex automation.
Troubleshooting
Reportus yourIssuesJoinourDiscord Server
Installation
- Install homebridge using:
sudo npm install -g homebridge - Install this plugin using:
sudo npm install -g homebridge-syntex-magichome - Update your
config.jsonfile. See snippet below. - Restart the Homebridge Service with:
sudo systemctl restart homebridge; sudo journalctl -fau homebridge
Example Config
Info: If the baseDirectory for the storage can't be created you have to do it by yourself and give it full write permissions!
sudo mkdir -p /var/homebridge/SynTex/( create the directory )sudo chmod -R 777 /var/homebridge/SynTex/( permissions for many processes )sudo chown -R homebridge /var/homebridge/SynTex/( permissions only for homebridge )
"platforms": [
{
"platform": "SynTexMagicHome",
"baseDirectory": "/var/homebridge/SynTex",
"options": {
"port": 1712,
"language": "us",
"pollingInterval": 10
},
"log": {
"debug": false
},
"accessories": [
{
"id": "light1",
"name": "Kitchen LED Strip",
"services": [
{
"type": "rgb",
"pins": "rgb",
"function": "light",
"ip": "DC4F22C5D4E1"
}
]
},
{
"id": "light2",
"name": "Living Room LED Strip",
"services": [
{
"type": "rgbw",
"pins": "grb",
"function": "light",
"ip": "192.168.1.100"
}
]
},
{
"id": "pswitch1",
"name": "Kitchen Color Strobe Flash (Party)",
"services": [
{
"type": "switch",
"function": "preset-switch",
"ips": {
"192.168.1.100": "255,255,255"
},
"preset": "seven_color_strobe_flash",
"speed": 60
}
]
},
{
"id": "pswitch2",
"name": "All Lights Cross Fade (Soothing)",
"services": [
{
"type": "switch",
"function": "preset-switch",
"ips": {
"DC4F22C5D4E1": "0,150,255",
"192.168.1.100": "102,255,102"
},
"preset": "seven_color_cross_fade",
"speed": 40,
"shouldTurnOff": true
}
]
},
{
"id": "rswitch1",
"name": "Reset All Switches to Default",
"services": [
{
"type": "switch",
"function": "scene-switch",
"ips": {
"192.168.1.100": "255,255,255"
}
}
]
},
{
"id": "multi1",
"name": "Multi Accessory",
"services": [
{
"type": "rgbw",
"function": "light",
"name": "Single Color",
"ip": "192.168.1.100"
},
{
"type": "switch",
"function": "preset-switch",
"name": "Color Fade",
"ips": {
"192.168.1.100": "255,255,255"
},
"preset": "seven_color_strobe_flash",
"speed": 60
}
]
}
]
}
]Required Parameters
platformis alwaysSynTexMagicHomebaseDirectoryThe path where cache data is stored.accessoriesFor the accessory config.
Optional Parameters
portTo control your accessory over HTTP calls.languageYou can use your country initials if you want to change it ( Currently supported:us,en,de)pollingIntervaldefines how often the plugin should chech the Magic Home device state ( in seconds )
Log Parameters
- Disable certain log level:
error,warn,info,read,update,successanddebug( for exampledebug: false)
Accessory Config
- Every accessory needs these parameters:
id,nameandservices( required ) idhas to be either areal mac addressor anotherrandom unique text( no duplicates! )namecould be anything.serviceschoose a device config from below.
Light Config
namecould be anything.typemust be eitherrgb/rgbw( based on your device: look below )pinscan change the order of your pin setuprgb/grb/brg( every possible combination )functionis alwayslightipuse a normal IP or a MAC address.
Preset Switch Config
namecould be anything.typemust be aswitch( for preset and reset switches )functionis alwayspreset-switchipsmust be a key-value object wherekeyis MagicHome LED IP Address192.168.1.100orDC4F22C5XXXXMAC Address andvalueis the default rgb color of the light"255,255,255" ( white )presetis the name of the preset you want to use for the effect ( seeAvailable Presets Scenesbelow )speeddefines the speed of the effect ( from 0 to 100 )
Scene Switch Config
namecould be anything.typemust be aswitch( for preset and reset switches )functionis alwaysscene-switchipsmust be a key-value object wherekeyis MagicHome LED IP Address192.168.1.100orDC4F22C5XXXXMAC Address andvalueis the default rgb color of the light"255,255,255" ( white )
You can use MAC Address instead of IP Address as well. Please format the MAC Address. It should be in capital letters and : should not be present DC4F22C5XXXX
SynTex UI
Control and set up your devices by installing homebridge-syntex
This plugin is made for plugin management, automation system and device control.
Check out the GitHub page for more information: https://github.com/SynTexDZN/homebridge-syntex
Update MagicHome Device
- Open
http://Bridge IP/devices?id=Device ID&value=New Value - Insert the
Bridge IPandDevice ID - For the
New Valueyou can type this pattern:
- For boolean devices:
true/false( colored light, preset switch, reset switch ) - For colored lights add
&hue=New Hue or&saturation=New Saturation or&brightness=New Brightness ( have to be numbers ) - For accessories with multiple service types add
&type=SERVICETYPE - For accessories with multiple services with more than one of the same service type add
&counter=SERVICENUMBER
( First of that type = 0, second = 1 .. )
Example: http://homebridge.local:1712/devices?id=ABCDEF1234567890&type=rgb&counter=0&value=true&hue=4&saturation=100&brightness=100
( Updates the value, hue, saturation and brightness of ABCDEF1234567890 to turned on, orange color, 100% saturation, 100% brightness for example )
Read MagicHome Device
- Open
http://Bridge IP/devices?id=Device ID - Insert the
Bridge IPandDevice ID
- For accessories with multiple service types add
&type=SERVICETYPE - For accessories with multiple services with more than one of the same service type add
&counter=SERVICENUMBER
( First of that type = 0, second = 1 .. )
Example: http://homebridge.local:1712/devices?id=ABCDEF1234567890
( Reads the state of ABCDEF1234567890 for example )
Remove MagicHome Device
- Open
http://Bridge IP/devices?id=Device ID&remove=CONFIRM - Insert the
Bridge IPandDevice ID
- To remove a specific service add
&type=SERVICETYPE - To remove a specific service from an accessory with more than one of the same service type add
&counter=SERVICENUMBER
( First of that type = 0, second = 1 .. )
Example: http://homebridge.local:1712/devices?id=ABCDEF1234567890&remove=CONFIRM
( Removes ABCDEF1234567890 from the Config and Home App )
Automation
To enable the automation module you have to create a file named automation.json in your baseDirectory >> automation or install the homebridge-syntex plugin to create them via UI ( only between SynTex plugins )
Example: For manual configuration update your automation.json file. See snippet below.
{
"automation": [
{
"id": 0,
"name": "Demo Automation",
"active": true,
"trigger": {
"logic": "AND",
"groups": [
{
"logic": "OR",
"blocks": [
{
"id": "multi2",
"name": "Multi Device",
"letters": "F0",
"plugin": "SynTexWebHooks",
"operation": "<",
"state": {
"value": 1000
}
},
{
"operation": "=",
"time": "16:00",
"options": {
"stateLock": true
}
}
]
},
{
"logic": "AND",
"blocks": [
{
"id": "multi1",
"name": "Multi Switch",
"letters": "41",
"plugin": "SynTexWebHooks",
"operation": "=",
"state": {
"value": false
},
"options": {
"stateLock": true
}
},
{
"operation": "=",
"days": [
1,
2,
3,
4,
5
]
}
]
}
]
},
"result": [
{
"id": "light1",
"name": "Kitchen LED Strip",
"letters": "30",
"plugin": "SynTexMagicHome",
"operation": "=",
"state": {
"value": true,
"hue": 4,
"saturation": 100,
"brightness": 100
}
},
{
"id": "extern1",
"name": "Extern Accessory",
"letters": "40",
"bridge": "192.168.1.100",
"plugin": "SynTexWebHooks",
"operation": "=",
"state": {
"value": false
},
"options": {
"stateLock": false
}
},
{
"operation": "=",
"delay": 1000
},
{
"url": "http://192.168.1.100:1712/devices?id=ABCDEF1234567890&value=true&brightness=100"
}
]
}
]
}Required Parameters
idA unique ID of your automation.nameThe name of the automation.activeEnable / disable a single automation.triggerWhat triggers the automation?logicDefine a logical operation for your groups (AND,OR)groupsLogical layer onelogicDefine a logical operation for your blocks (AND,OR)blocksLogical layer two
resultWhat happens when running an automation?optionsGeneral automation optionstimeLockSet a timeout to prevent to many executions ( in milliseconds )
Block Configuration
Service Block ( Trigger, Result )
idis the same like in your config file ( or in your log )nameThe name of the accessory.lettersSee letter configuration below.bridgeIP of your other bridge ( optional )pluginUse the platform name of the plugin ( optional, see supported plugins below )operationUse the logical operands (>,<,=)stateThe state of your accessory.valueis used for the main characteristic.brightnesscan be used for dimmable / RGB lights.huecan be used for RGB lights.saturationcan be used for RGB lights.
Time Block ( Trigger )
operationUse the logical operands (>,<,=)timeDefine a time point ( e.g.16:00)
Weekday Block ( Trigger )
operationUse the logical operands (=)daysSet the weekdays ( from0to6)
Delay Block ( Result )
delaySet a timeout ( in milliseconds )
URL Block ( Result )
urlFetch an URL.
Letter Configuration
The letters are split into two parts ( characters )
1. Service Type
- 0 : Occupancy
- 1 : Smoke
- 2 : Airquality
- 3 : RGB
- 4 : Switch
- 5 : Relais
- 6 : Stateless Switch
- 7 : Outlet
- 8 : LED
- 9 : Dimmer
- A : Contact
- B : Motion
- C : Temperature
- D : Humidity
- E : Rain
- F : Light
- G : Blind
- H : Thermostat
- I : Fan
2. Duplicate Counter
- If there are more services of the same type the counter indicates which is which
- Simply count from top to bottom.
Example: The first switch in your config has the letters 40, the second 41 and so on ..
Supported Plugins
- SynTexKNX (
homebridge-syntex-knx) - SynTexMagicHome (
homebridge-syntex-magichome) - SynTexTuya (
homebridge-syntex-tuya) - SynTexWebHooks (
homebridge-syntex-webhooks)
Compatible Devices
Any devices created by Zengge and running on the Magic Home Wi-Fi App ( or other apps by the same developer such as LED Magic Color ) should work with this plugin. Some examples of compatible devices are:
- 5 Channel Controller for RGB LED Strip
rgbw - Magic UFO RGBW LED Strip controller
- SuperLegends Wi-Fi smart bulb
rgb - Victorstar Wi-Fi Smart Light Bulb
- Flux Wi-Fi Light Bulb
- Fen-Yi Light Bulb
- Waterproof RGB LED Strips WIFI Controller
rgb - Eastlion RGB Wi-Fi Strip Controller
Available Presets Scenes
seven_color_cross_fade
red_gradual_change
green_gradual_change
blue_gradual_change
yellow_gradual_change
cyan_gradual_change
purple_gradual_change
white_gradual_change
red_green_cross_fade
red_blue_cross_fade
green_blue_cross_fade
seven_color_strobe_flash
red_strobe_flash
green_strobe_flash
blue_stobe_flash
yellow_strobe_flash
cyan_strobe_flash
purple_strobe_flash
white_strobe_flash
seven_color_jumpingAvailable Custom Presets Scenes
gradual_color_fade
dark_gradual_color_fade
strobe_lights
police_lights