I don’t know how to program JSON, but, I do subscribe to ChatGPT+, which gives me access to GPT-4… and I’m desperate enough for needing Lifx bulb color syncing to ask it to write the code for me
Could any of you fine folks familiar with this take a look at the code for accuracy/effectiveness and tell me how to implement it? Of course, this could be totally incorrect - but according to most sources GPT-4 is great with programming. Plus, this is pretty interesting stuff…
{
"name": "Sync Hue, Saturation, Brightness, and On/Off",
"actions": [
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "colorControl",
"attribute": "color"
}
},
"right": {
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "colorControl",
"attribute": "color"
}
}
},
"then": [
{
"command": {
"devices": [
"bulb-1-id",
"bulb-2-id",
"bulb-3-id"
],
"component": "main",
"capability": "colorControl",
"command": "setColor",
"arguments": [
{
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "colorControl",
"attribute": "color"
}
}
]
}
}
],
"else": []
}
},
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "switchLevel",
"attribute": "level"
}
},
"right": {
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "switchLevel",
"attribute": "level"
}
}
},
"then": [
{
"command": {
"devices": [
"bulb-1-id",
"bulb-2-id",
"bulb-3-id"
],
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "switchLevel",
"attribute": "level"
}
}
]
}
}
],
"else": []
}
},
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "switch",
"attribute": "switch"
}
},
"right": {
"device": {
"devices": [
"master-bulb-id"
],
"component": "main",
"capability": "switch",
"attribute": "switch"
}
}
},
"then": [
{
"command": {
"devices": [
"bulb-1-id",
"bulb-2-id",
"bulb-3-id"
],
"component": "main",
"capability": "switch",
"command": {
"device": {
"devices": [
"master-bulb-id"
],
"component