iFrame in picture-elements panel view?

OK, great!
It looks like Motioneye doesn’t send a second (timeout) message after no motion is detected for a while, so you could add a Trigger node in NR to handle that function:

[{"id":"230812e0.66a52e","type":"change","z":"43d5ef6e.4b6a9","name":"Syntax: view_path","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"data\":{\"view_path\":\"\"}}","tot":"json"},{"t":"move","p":"payload","pt":"msg","to":"payload.data.view_path","tot":"msg"},{"t":"change","p":"payload.data.view_path","pt":"msg","from":"on","fromt":"str","to":"courtyard_camera","tot":"str"},{"t":"change","p":"payload.data.view_path","pt":"msg","from":"off","fromt":"str","to":"dashboard","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":80,"wires":[["d0c7c4bd.11b7b8"]],"info":" - Change `msg.data.new_state.entity_id` from `input_select.${camera_short_name}_cast` to `${camera_short_name}_feed`\n - Move `msg.data.new_state.entity_id` to `payload.data.view_path`"},{"id":"d0c7c4bd.11b7b8","type":"api-call-service","z":"43d5ef6e.4b6a9","name":"Living Area Hub","server":"e9beaddb.fc24e","version":1,"debugenabled":false,"service_domain":"cast","service":"show_lovelace_view","entityId":"media_player.living_area_hub","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":880,"y":80,"wires":[[]]},{"id":"89da533.a8ebab","type":"trigger","z":"43d5ef6e.4b6a9","name":"","op1":"","op2":"{\"test\":\"2\"}","op1type":"pay","op2type":"json","duration":"30","extend":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":410,"y":80,"wires":[["f9ac8bcc.6d82e8","230812e0.66a52e"]]},{"id":"f9ac8bcc.6d82e8","type":"mapper","z":"43d5ef6e.4b6a9","name":"Toggle","property":"payload","map":[{"search":"on","replace":"{\"service\":\"turn_on\"}"},{"search":"off","replace":"{\"service\":\"turn_off\"}"}],"passthrough":false,"x":670,"y":140,"wires":[["f2b9be8b.676c2"]]},{"id":"7bfcf0d5.b9e02","type":"http in","z":"43d5ef6e.4b6a9","name":"","url":"/courtyard_camera","method":"post","upload":false,"swaggerDoc":"","x":170,"y":80,"wires":[["efff12ab.54db4","89da533.a8ebab"]]},{"id":"f2b9be8b.676c2","type":"api-call-service","z":"43d5ef6e.4b6a9","name":"Courtyard Motion","server":"e9beaddb.fc24e","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":870,"y":140,"wires":[[]]},{"id":"efff12ab.54db4","type":"http response","z":"43d5ef6e.4b6a9","name":"","statusCode":"","headers":{},"x":230,"y":140,"wires":[]},{"id":"e9beaddb.fc24e","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Here’s how this one is configured:

  • Your initial message (test:1) would be passed through when motion is detected.
  • It would then wait 30 seconds after the last message was received (if motion is triggered again within the initial 30 seconds it will restart the 30 second timer).
  • After 30 seconds with no motion trigger it would send a second JSON formatted message (test:2) which you can use to reset your view_path and input_boolean.

Of course you can rename these key/value pairs (test/1, test/2) to whatever you like and update the Change and Mapper nodes accordingly.

Works great thank you so much.

I changed the trigger sent massages to “on” / “off” to match your original flow and no matter what payload I receive from motioneye will be consider “on” and then will be switch to “off” after 30sec.


1 Like

Oh that’s a good idea. I wish I’d thought of the Trigger node earlier.

Glad everything’s working!

Hello again,
I managed to get two different msg.payload based on trigger state, but I cant figured out how to use the payload : object to trigger ON/OFF state.
Maybe you can help.



motioneye12
motioneye13
motioneye14

After reading some blogs I find a way to configure motioneye using the config file not the UI,
and I force to have a run command when motion detection stop.

on_event_end /usr/local/lib/python2.7/dist-packages/motioneye/scripts/relayevent.sh “/etc/motioneye/motioneye.conf” stop %t; /usr/bin/python /usr/local/lib/python2.7/dist-packages/motioneye/meyectl.pyc webhook -c /etc/motioneye/motioneye.conf ‘POSTj’ ‘http://172.16.10.12:1880/endpoint/notifycam2?motion=clear’; mosquitto_pub -h 172.16.10.12 -t cam2/motion -m OFF

on_event_start /usr/local/lib/python2.7/dist-packages/motioneye/scripts/relayevent.sh “/etc/motioneye/motioneye.conf” start %t; /usr/bin/python /usr/local/lib/python2.7/dist-packages/motioneye/meyectl.pyc webhook -c /etc/motioneye/motioneye.conf ‘POSTj’ ‘http://172.16.10.12:1880/endpoint/notifycam2?motion=detected’; mosquitto_pub -h 172.16.10.12 -t cam2/motion -m ON

Try it this way…

[{"id":"f6087f9b.03fb5","type":"switch","z":"43d5ef6e.4b6a9","name":"Motion Detected or Clear","property":"payload.motion","propertyType":"msg","rules":[{"t":"eq","v":"detected","vt":"str"},{"t":"eq","v":"clear","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":500,"y":400,"wires":[[],[]]}]
1 Like

You are good :slight_smile:!
Works perfect.
Thanks a lot.

1 Like

No problem, glad to help! :slightly_smiling_face:

You could consolidate your two Call Service nodes into one by defining the “on”/“off” functions in a payload from an upstream Change or Mapper node. How difficult this would be would depend on how complex your script is (eg: whether Data is also defined for the Service called).

And I’m not positive, but I think you could also eliminate the motion key altogether by just sending ?detected and ?clear (or ?on / ?off) as the payloads from Motioneye (IE: delete motion= from the URLs, then delete .motion from your NR switch Property).

My script is simple, I’m using browser_mod to navigate to cam_ui and also to play a charm tone for notification.

cam1motionon:
  alias: 'cam1 motion on'
  sequence:
    - service: media_player.play_media
      data:
        media_content_id: /local/timer.mp3
        media_content_type: music
    - service: browser_mod.navigate
      data:
        navigation_path: /ui-experimental/7
        deviceID: 207fb67e-7e01d6b1 

cam1motionoff:
  alias: 'cam1 motion off'
  sequence:
    - service: browser_mod.navigate
      data:
        navigation_path: /ui-experimental/0
        deviceID: 207fb67e-7e01d6b1

This is how the resort look like.


I’ll give a try to consolidate it … I’ll let you know or probably ask for help :upside_down_face:!

1 Like

Your interface looks awesome! :sunglasses:

You could actually get this down to two nodes (assuming you don’t want the HTTP Response node). Just attach a Call Service node directly to your HTTP In node with only the Domain field defined:

Then change you Motioneye payloads to ?service=cam1motionon and ?service=cam1motionoff.

1 Like

I changed the payloads in Motioneye to ?service=cam1motionon and ?service=cam1motionoff and call service works great.
I tried the change to ?detected and ?clear but the payloads wore empty.
Sorry for my ignorance but I don’t know what HTTP Response node does, I see it in your flow but I don’t know the use.
My lovelace is based on floorplan-card edited in svg file and animated in css, integrated with graph and some other cards and browser_mod for popups and navigation.The big advantage of svg file is that is fully editable and small in size (my main floor is the largest file and is 670kb, fast to load on tablets).

Thanks again for your time helping.

1 Like

I’m a big fan of .SVGs too, I might also convert my dashboards. Which editor are you using; Inkscape?
I’ve found this to be a great site for creating animated SVGs if you’re interested in that.

The HTTP Response node just returns an acknowledgement to the sender (Motioneye) to keep it from retrying, logging errors, etc. No configuration is needed in NR, you just attach it to the flow and it automatically responds.

There’s probably some way to send only values without keys via POST but I guess it’s not as simple as I was assuming. Oh well, it turns out to not be helpful in this case anyway.

Glad everything’s working! :slightly_smiling_face:

Nice work on those animated icons.Looks like a great online svg editor :+1:, I have to check it out.
I use Inkscake indeed, with floorplan-card ( https://github.com/pkozul/lovelace-floorplan) all dashboard is a svg file and you can create/import/edit svg elements and use there names linked with your home-assistant entities, there class state/animations are define in a separate css file.

If you are interested to try it I can send you some sample floorplan-card to see few animations.
Also I can share parts (unfortunately not all is functional as is still in working progress) of my config to have a start point.

inkscape view

few popups views also including svg files




1 Like

Thank you!

I actually used floorplan a few years ago and already have a basic layout…


…but when I get ready to convert back (partially) I might hit you up for some tips. :slightly_smiling_face:

Whenever you want just send me a personal message with a email where to send files.
Glad to help.
You also can check those two awesome config, that inspire me too … they are not using floorplan-card but are a good inspiration in what they created.


1 Like

Hello,
I hope you doing well.
I see you are a NR Master Guru and I have couple of questions about few things, maybe you can help:

  • is there a way to disable a selected sequence without deleting lines between nodes?
  • what is the relevance of QoS in mgtt?
    mqtt

Thank you in advance for your time.

1 Like

I still have a lot to learn about NR (and HA), but thanks for the vote of confidence. :smiley:

  • Any node can be disabled either;

    So in your case disabling the first (leftmost) node would eliminate any input to the following nodes – effectively disabling the entire flow.

  • The QoS (Quality of Service) settings for the MQTT Out node are defined here. I would think you’d want to keep it at the lowest reliable setting to avoid unnecessary network congestion so you may want to try 0 for a while first to see if messages are missed, then move to 1 if needed, then 2 if needed.

1 Like

Got it, thanks a lot for your help. :+1:

1 Like

Hey@lukevink

I am hoping you can help me out with your card. I would like to use this card to display weather radar in my picture element dashbard , but this is what I am getting when add it to the page
image
I have added the .js to my www/js directory and I have added the url to config/lovelace/resources. Am I missing something?

impressive! can you share code please?

nvm you already did! i need to read more :slight_smile: