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. Home Assistant
  4. Optimistic parameter in Home Assistant

Optimistic parameter in Home Assistant

Scheduled Pinned Locked Moved Home Assistant
8 Posts 4 Posters 1.0k Views 4 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
    Marek
    wrote on last edited by
    #1

    Hi, the HOme Assistant documentation says that for MySensors integration you can set the 'optimistic' parameter. But how to do it? I have an MQTT gateway.

    1 Reply Last reply
    0
    • electrikE Offline
      electrikE Offline
      electrik
      wrote on last edited by
      #2

      In your configuration.yaml add this

      mysensors:
        optimistic: true
      

      And restart home assistant

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

        Doesn't work.
        Invalid config for [mysensors]: required key not provided @ data['mysensors']['gateways']. Got None. (See /config/configuration.yaml, line 175).
        Gateways I have defined in the integrations UI.

        BearWithBeardB 1 Reply Last reply
        0
        • M Marek

          Doesn't work.
          Invalid config for [mysensors]: required key not provided @ data['mysensors']['gateways']. Got None. (See /config/configuration.yaml, line 175).
          Gateways I have defined in the integrations UI.

          BearWithBeardB Offline
          BearWithBeardB Offline
          BearWithBeard
          wrote on last edited by BearWithBeard
          #4

          @Marek If you only copy and pasted the above two lines into your config, then you got that error message because it is an incomplete configuration for the old, YAML-based MySensors integration.

          A valid YAML configuration looks, or rather looked, like this:

          mysensors:
            gateways:
              - device: mqtt
                persistence_file: '/config/mysensors.json'
                topic_in_prefix: 'mysensors-out'
                topic_out_prefix: 'mysensors-in'
              - device: mqtt
                persistence_file: '/config/mysensors_testing.json'
                topic_in_prefix: 'mytest-out'
                topic_out_prefix: 'mytest-in'
            optimistic: true
            retain: true
            version: '2.3'
          

          You may be able to set the optimistic setting by adding something like this to your config and restarting Home Assistant. You may also need to delete your existing UI-based integration beforehand.

          That being said, the old YAML configurations are not recommended (and apparently neither documented) anymore. When a YAML-based MySensors configuration is detected after a HA start, it will be migrated to the new UI-based integration automatically. Subsequent changes to the YAML config will be ignored.

          AFAIK, the new UI-based intregration deprecated a bunch of configuration options and I think that the optimistic setting is one of them. I don't know of a way to set it using the UI-based integration, nor if it'll be carried over by importing an "existing" YAML config. The documentation of the MySensors integration may be incorrect / outdated here.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Marek
            wrote on last edited by
            #5

            I did as you advised. I deleted Mysensors in gui. I added the configuration in configuration.yaml. After rebooting HA still does not optimistic work. There is an entry in the log: 'optimistic option for mysensors is deprecated. Please remove optimistic from your configuration file '.
            I'm afraid Home Assistant has killed the ability to use battery-operated MySensors devices.

            1 Reply Last reply
            0
            • BearWithBeardB Offline
              BearWithBeardB Offline
              BearWithBeard
              wrote on last edited by
              #6

              No, Home Assistant didn't render battery-powered nodes unusable.

              I have never used the optimistic mode in Home Assistant, yet I'm able to achieve uptimes of more than a year with CR2032-powered (merely ~230 mAh) MySensors nodes. See here for an example. The temperature sensor I mentioned there is still working since April 2020, reporting every 5 minutes.

              In which use case would the optimistic mode be necessary?

              I mean, you have full control over the node's behavior. If you want to go as easy on the batteries as possible, you can put a node back to sleep as soon as it has sent a new measurement once, without waiting for any feedback. For more critical sensors (i.e. security-related) and actors on the other hand, you probably want confirmation that the data was successfully received and rather replace the batteries a little bit earlier, don't you?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Marek
                wrote on last edited by
                #7

                Temperature measurement is not a problem. It doesn't need optimistic mode.
                I have my DIY nodes that control heating in rooms (radiators). They are battery devices. Every 5 minutes they wake up to check if the switch (S_BINARY) is turned on or not. This switch requires optimistic mode.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  Gibber
                  wrote on last edited by
                  #8

                  I have encountered the same situation trying to use a switch to control some blinds.
                  Has there been any update on this issue from either Home Assistant or MySensors, or any workaround developed?

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  10

                  Online

                  12.0k

                  Users

                  11.2k

                  Topics

                  113.4k

                  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