Feature Request: MQTT Support

  • It would be great if F.lux can publish color temp and brightness to a MQTT broker/topic so it can be used with pretty much every open home automation platforms current available.

    I am currently running Home Assistant to control the Yeelight Ceiling light in my room. Since F.lux can't control this light directly, I customized a php page hosted on an instance of Apache to translate the http posts from f.lux to MQTT messages so Home Assistant can pick it up and change the color temp and brightness accordingly.


  • Awesome suggestion! +1

  • Hey Jensen. Would you be willing to share your PHP code?


  • its pretty hacky but it works for me (i tried it on xampp for windows but its currently running on a ubuntu apache + php 7)

    you will need to fine tune the variables to the maximum values that your light will support or you can send the raw values from flux to mqtt and handle it from homeassistant or whatever it is you are using...

    and you need the phpMQTT library

    download linky

    sensor setup for homeassistant

    • platform: mqtt
      state_topic: 'flux/data'
      name: 'Flux Status'
      value_template: '{{ value_json.fluxstate }}'
    • platform: mqtt
      state_topic: 'flux/data'
      name: 'Flux Color Temperature'
      value_template: '{{ value_json.colortemp | round(0) }}'
    • platform: mqtt
      state_topic: 'flux/data'
      name: 'Flux Brightness'
      value_template: '{{ value_json.brightness | round(0) }}'
    • platform: mqtt
      state_topic: 'flux/data'
      name: 'Flux Timestamp'
      value_template: '{{ value_json.timestamp | timestamp_local }}

    name: Change Light to Flux Data
    initial: on

Log in to reply