Controlling Wiz RGBW Smart lightbulbs from Godot 4 @dev-unfa
Controlling Wiz RGBW Smart lightbulbs from Godot 4  @dev-unfa
Uploaded December 2022 | Updated November 2026, 2 days ago
Source for research:
github.com/sbidy/pywizlight

Here's a quick code dump so you can play with it:
```
extends Node

var INTERVAL = 0.1 # seconds
const PORT = 38899
const ADDRESS = [ # list the IP addresses of your lights or broadcast to all (less reliable, hogs the network)
# "192.168.0.255", # need to do peer.set_broadcast_enabled(true) before using this
"192.168.0.16",
"192.168.0.17",
"192.168.0.18",
]
@onready var peer = PacketPeerUDP.new()

func wiz_broadcast(data:String):
for address in ADDRESS:
peer.set_dest_address(address, PORT)
peer.put_packet(data.to_ascii_buffer())
peer.close()

# Called when the node enters the scene tree for the first time.
func _ready():
while true:
wiz_broadcast('{"method": "setPilot", "params": {"temp": ' + str(randi_range(1000, 10000)) + '}}') # set white of random color temperature (in Kelvin)
await get_tree().create_timer(INTERVAL).timeout
wiz_broadcast('{"method": "setPilot", "params": {"dimming": 10}}') # min
await get_tree().create_timer(INTERVAL).timeout
wiz_broadcast('{"method": "setPilot", "params": {"dimming": 100}}') # max
await get_tree().create_timer(INTERVAL * 2).timeout
wiz_broadcast('{"method": "setPilot", "params": {"r": 0}}') # set an arbitrary RGB color
wiz_broadcast('{"method": "setPilot", "params": {"g": 255}}')
wiz_broadcast('{"method": "setPilot", "params": {"b": 255}}')
await get_tree().create_timer(INTERVAL * 4).timeout
wiz_broadcast('{"method": "setPilot", "params": {"state": false}}') # turn off
await get_tree().create_timer(INTERVAL * 4).timeout
```
Controlling Wiz RGBW Smart lightbulbs from Godot 4Rendering an IRC log to a beautiful PNG sequence: irc2pngPlaying and making Liblast (a FOSS multiplayer FPS made with Godot 3)Handfulare ya coding juan? (unfa remix)Blenders snap to face is broken?Killing yourself during a castle flyby after finishing Return To NaPali (Unreal Mission Pack 1)unfa casually plays Counter-Strike 2unfa casually plays Counter-Strike 2Imagine Providing ValueFlatOut2 - 5 laps, 5 wrecked opponents (Nvidia sucks on Linux)Slow-Mo Ice Coffee
/dev/unfa |

Controlling Wiz RGBW Smart lightbulbs from Godot 4

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER