Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. MQTT Dimmer

MQTT Dimmer

Scheduled Pinned Locked Moved OpenHAB
3 Posts 2 Posters 2.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moskovskiy82
    wrote on last edited by
    #1

    I have set up an led dimmer.
    It somehow works when i send an mqtt command like this
    $ mosquitto_pub -t mygateway1-in/88/0/0/0/3 -m "10"

    This is what i have in my items

    Dimmer  Dimmed_Light    "Dimmer Light [%d %%]"  <slider> { mqtt=">[mymosquitto:mygateway1-in/88/0/0/3:state:*:default]" }
    

    Then a rule

    /**
     * This is a demo rule which simulates a real dimmer by reacting to increase/decrease commands
     * and posting an updated state on the bus
     */
    rule "Dimmed Light"
        when
            Item Dimmed_Light received command
        then
            var Number percent = 100
            if(Dimmed_Light.state instanceof DecimalType) percent = Dimmed_Light.state as DecimalType
    
            if(receivedCommand==INCREASE) percent = percent + 5
            if(receivedCommand==DECREASE) percent = percent - 5
    
            if(percent<0)   percent = 0
            if(percent>100) percent = 100
    
            postUpdate(Dimmed_Light, percent);
    end
    

    Sitemap Slider item=Dimmed_Light

    Somehow clicking on slider buttons does nothing. I don'e even see the messages when i subscribe to the mymosquitto:mygateway1-in channel. So seems the problem i have misconfiguration in the items string.
    At the same time relay module works defined in items like this

    Switch vent_vsr_high "Vent High" { mqtt=">[mymosquitto:mygateway1-in/55/3/1/0/2:command:ON:1],>[mymosquitto:mygateway1-in/55/3/1/0/2:command:OFF:0]" }```
    CJ CassarinoC 1 Reply Last reply
    0
    • M moskovskiy82

      I have set up an led dimmer.
      It somehow works when i send an mqtt command like this
      $ mosquitto_pub -t mygateway1-in/88/0/0/0/3 -m "10"

      This is what i have in my items

      Dimmer  Dimmed_Light    "Dimmer Light [%d %%]"  <slider> { mqtt=">[mymosquitto:mygateway1-in/88/0/0/3:state:*:default]" }
      

      Then a rule

      /**
       * This is a demo rule which simulates a real dimmer by reacting to increase/decrease commands
       * and posting an updated state on the bus
       */
      rule "Dimmed Light"
          when
              Item Dimmed_Light received command
          then
              var Number percent = 100
              if(Dimmed_Light.state instanceof DecimalType) percent = Dimmed_Light.state as DecimalType
      
              if(receivedCommand==INCREASE) percent = percent + 5
              if(receivedCommand==DECREASE) percent = percent - 5
      
              if(percent<0)   percent = 0
              if(percent>100) percent = 100
      
              postUpdate(Dimmed_Light, percent);
      end
      

      Sitemap Slider item=Dimmed_Light

      Somehow clicking on slider buttons does nothing. I don'e even see the messages when i subscribe to the mymosquitto:mygateway1-in channel. So seems the problem i have misconfiguration in the items string.
      At the same time relay module works defined in items like this

      Switch vent_vsr_high "Vent High" { mqtt=">[mymosquitto:mygateway1-in/55/3/1/0/2:command:ON:1],>[mymosquitto:mygateway1-in/55/3/1/0/2:command:OFF:0]" }```
      CJ CassarinoC Offline
      CJ CassarinoC Offline
      CJ Cassarino
      wrote on last edited by
      #2

      @moskovskiy82

      Looking for an answer on this too? Did you happen to figure this out?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moskovskiy82
        wrote on last edited by
        #3

        Check out the other topic http://forum.mysensors.org/topic/3664/mqtt-dimmer-message/7

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        34

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular