• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 713 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 Sep 22, 2019, 9:59 AM Sep 22, 2019, 8:53 AM

    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.

    C 1 Reply Last reply Dec 7, 2020, 1:47 AM Reply Quote 1
    • M Offline
      mjmare
      last edited by Dec 6, 2020, 1:36 PM

      Very useful. Thx!

      1 Reply Last reply Reply Quote 0
      • C Offline
        cowboysdude Module Developer @fribse
        last edited by Dec 7, 2020, 1:47 AM

        @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
        • 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