Set Light Level using REST

I’m working on a wall mounted tablet based UI and using the REST API for the integration. Its working really well so far but I can’t seem to figure out how to set the dim level of a dimmable bulb or switch. I had expected to find a service called light/set_level or something similar but it seems to be conspicuously absent. I also tried passing the brightness level to switch/turn_on but got an error in the log.

Can anyone tell me what I am missing here?

If anyone is interested, my project is a port of the HA Dashboard that forum user @florianz created for Smart Things. I have taken his awesome concept and re-engineered it to work with Home Assistant, using REST calls from the Ruby backend, and a standalone python daemon to stream events back to the dashboard in real time. I’ll post a writeup when I have it finished.

Here’s a quick screenshot.

3 Likes

You should be able to use the turn on service and set the brightness attribute to a value.

Test this in the dev tools services page in the HA GUI.

Thanks - I’ll give it a try.