Screenmqtt - monitors / screens as MQTT Lights

I’ve looked around for this, but didn’t find anything, so I whipped up a prototype.

It allows you to add a regular computer monitor as an MQTT Light in Home Assistant. It still has a ways to go, but it seems fairly useful already.

Here’s a video: https://www.youtube.com/watch?v=OtXcdj2fkGw

Is anyone else interested in this or am I just crazy?

I should probably chisel out a releasable version and prop it up on GitHub anyway.

4 Likes

This could be useful for some moccupancy type stuff. Simulate activity in the office when away. I’m interested. :slight_smile:

Looks interesting, hard to say more until I can see if it’s something I can deploy. But neat!

@CCOSTAN oh cool, I didn’t even think of that use!

@rpitera yeah, I have to clean it up and put it up somewhere, it’s currently Windows only as I’m using some win32 APIs directly, but no real reason it couldn’t work on macOS / Linux with some tweaking.

2 Likes

Oh no, time escapes me!

Welp, I stole some sleep to make some more progress on this, hopefully I’ll have a cleaned up alpha version up for testing soon!™

Also I found a way to hook into monitor “sleep mode” in Windows (SC_MONITORPOWER / GUID_MONITOR_POWER_ON) and I can get an event for when they turn on / off via user activity, so you could do neat things like turn on the lights when the monitors wake up.

1 Like

Umm. Yeah. I DEFINATELY want this. I have four monitors that I really want to be able to turn off /sleep via automation. I REALLY want this. What do we need to do to get me testing this. :slight_smile:

I need to clean up my code and add the ability to configure it (yaml file?), as many things are currently hardcoded :slight_smile:

I don’t think it’s going to work well for most people until I add some more advanced configuration though, like configuring names for monitors based on some kind of a hardware ID, but I haven’t gotten that far yet. So far it only uses the model name as the monitor name from DDC/CI. That’s not ideal though as many people probably have multiple monitors of the same model and the model name is probably often incorrect. For example my Dell U2515H has it set to “U2515H”, while my old Samsung 226BW has it set to “MEDEL” for some reason. Maybe newer ones are better at that.

i have such thing for my linux raspberry attached monitor but only on off… those is onnected to my motion sensor… goal is to turn on the screnn only when i enter the room and wanna watch mmy dasboard, it also can turn it off…

if someone is interested i can share the “switch”

I’ve only researched this topic for Windows, so seeing how it’s done in Linux would be pretty helpful, I think! :slight_smile:

I am actually trying to figure out the brightness controll… usefull for LUX sensor :slight_smile: will keep u posted

1 Like

Well, as soon as you are ready for a beta tester, ring me up. I’m in and would really benefit from it.

Thanks
CARLO
@CCOSTAN

1 Like

Well… brightness is absolutely not possible on pi. Only with 1.1 official pi LCD Screen :frowning:

Maybe some of these might work? https://askubuntu.com/questions/149054/how-to-change-lcd-brightness-from-command-line-or-via-script

nope… it is just for intel users … I also tried the rpi_backlight but wont work.

Hmm, what do you get from ls -la /sys/class/backlight/?

@CCOSTAN

Here’s the first(-ish) alpha-level release: https://github.com/SmilyOrg/screenmqtt/releases/tag/v0.3.1

It’s barely configurable and probably broken for other PCs, but at least helpful enough if you can give me the log output of how it breaks!

Who needs sleep anyw :sleeping:

Edit: Oops, had to hotfix something I didn’t test, updated link.

1 Like

First issue.

Possible Fix:

Folder backlight is empty

@CCOSTAN Oh sorry, I forgot to add that dll! I might just statically link next time so you don’t need it. I just updated the 0.3.1 release to include it.

@thundergreen it might not be supported on your configuration then :confused: I’m not an expert in that stuff though, so maybe some workarounds exist still.

Cool… Let’s keep moving down the list. :slight_smile: