MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Now I'm getting somewhere, HA turns screen on and off :-)

    Scheduled Pinned Locked Moved Troubleshooting
    3 Posts 3 Posters 984 Views 3 Watching
    Loading More Posts
    • 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.
    • F Offline
      fribse
      last edited by fribse

      Ok, finally I found the right module. So the remote module in MagicMirror (MMM-Remote-Control), and then ‘rest_command:’ setup in HA.
      That way the motionsensor can turn the screen on and off in the mirror. For now I’ve made it simple with just defining four commands, two for on / off and two for dim / undim. And then just use those services in HA automations.
      Works perfectly.
      Now I need to turn some modules on and off depending on the time of day.

      The HA commands:

      rest_command:
        turn_off_mm_screen:
          url: http://IP:8080/api/monitor/off
        turn_on_mm_screen:
          url: http://IP:8080/api/monitor/on
        dim_mm_screen:
          url: http://IP:8080/api/brightness/75
        undim_mm_screen:
          url: http://IP:8080/api/brightness/100
      

      One of the automations (at night)

      - id: '1557033756115'
        alias: Turn on bathroom light at night
        trigger:
        - entity_id: binary_sensor.bathroom_movement
          from: 'off'
          platform: state
          to: 'on'
        condition:
        - after: '23:00'
          before: '7:59'
          condition: time
        - condition: state
          entity_id: light.spejl
          state: 'off'
        action:
        - data:
            brightness_pct: 10
            entity_id: light.spejl
          service: light.turn_on
        - data: {}
          service: rest_command.turn_on_mm_screen
        - data: {}
          service: rest_command.undim_mm_screen
      

      Next step would be to modify rest_command so that I don’t have one for each action, but send a payload that is modified to the command that I want.

      cowboysdudeC 1 Reply Last reply Reply Quote 1
      • M Offline
        mjmare
        last edited by

        Very useful. Thx!

        1 Reply Last reply Reply Quote 0
        • cowboysdudeC Offline
          cowboysdude Module Developer @fribse
          last edited by

          @fribse Nice job! I’m strictly using home assistant. Not tied to Magic Mirror at all. Home Assistant is a cool thing and I have it running my entire house :)

          1 Reply Last reply Reply Quote 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
          • 1 / 1
          • First post
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy