Get Status from MPC-BE ( or MPC-HC)
When mpc-be is closed the flow will send a ''Stopped'' command'' . This is why I created this flow like that... because sometime you turn off the app when a movie is playing. ( value is 1)
When mpc-be is set to stop the status is set to Stopped ( value is 1)
When mpc-be is playing the status is set to Playing ( value is 2)
When mpc-be is Paused the status is set to Playing ( value is 2)
Import this flow , and set the web interface to listen on the port you want, of course you can use proxy.
[{"id":"12ddad45.785b83","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"344236db.834b3a","type":"http request","z":"12ddad45.785b83","name":"Get MPC-BE status","method":"GET","ret":"txt","paytoqs":false,"url":"http://127.0.0.1:13579/variables.html","tls":"","proxy":"","authType":"","x":255,"y":52.00094985961914,"wires":[["ec8c738a.75749"]]},{"id":"d2a8894d.106d88","type":"inject","z":"12ddad45.785b83","name":"","topic":"","payload":"","payloadType":"date","repeat":"1.3","crontab":"","once":false,"onceDelay":"","x":75,"y":52.00094985961914,"wires":[["344236db.834b3a"]]},{"id":"30dce5ad.3b760a","type":"html","z":"12ddad45.785b83","name":"","property":"","outproperty":"","tag":"p","ret":"text","as":"single","x":470,"y":50.00094985961914,"wires":[["bc2956bc.fe6d78"]]},{"id":"bc2956bc.fe6d78","type":"change","z":"12ddad45.785b83","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[6]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":46.00094985961914,"wires":[["3ae99228.138b1e"]]},{"id":"e9976cca.db9ba","type":"rbe","z":"12ddad45.785b83","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":716.000020980835,"y":157.0009536743164,"wires":[["c2ad60d4.26fbb"]]},{"id":"c02a0b2b.680d68","type":"change","z":"12ddad45.785b83","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"error.message","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":465.99998474121094,"y":146.0009527206421,"wires":[["3ae99228.138b1e","27eef5c0.2d07ba"]]},{"id":"ec8c738a.75749","type":"switch","z":"12ddad45.785b83","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Error: connect EHOSTUNREACH 192.168.1.113:13579 : http://192.168.1.113:13579/variables.html","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":374.4166564941406,"y":93.83429145812988,"wires":[["30dce5ad.3b760a"]]},{"id":"c5e589d2.c1e8a8","type":"catch","z":"12ddad45.785b83","name":"","scope":["344236db.834b3a"],"uncaught":false,"x":68,"y":139.80656051635742,"wires":[["91b073d9.c466a","c02a0b2b.680d68"]]},{"id":"b8fecf23.75452","type":"debug","z":"12ddad45.785b83","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":80,"y":223.36212539672852,"wires":[]},{"id":"91b073d9.c466a","type":"switch","z":"12ddad45.785b83","name":"","property":"payload","propertyType":"msg","rules":[{"t":"empty"}],"checkall":"true","repair":false,"outputs":1,"x":60,"y":181.22318840026855,"wires":[["b8fecf23.75452"]]},{"id":"3ae99228.138b1e","type":"change","z":"12ddad45.785b83","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"Stopped","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"Error: connect ECONNREFUSED 127.0.0.1:13579","fromt":"str","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"Playing","fromt":"str","to":"2","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"Paused","fromt":"str","to":"3","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":624.6667022705078,"y":97.33427429199219,"wires":[["e9976cca.db9ba"]]},{"id":"c2ad60d4.26fbb","type":"http request","z":"12ddad45.785b83","name":"http node - Or use WTV you want (ex. MQTT, tcp , etc)","method":"GET","ret":"txt","paytoqs":false,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":1027,"y":65.5565071105957,"wires":[[]]},{"id":"27eef5c0.2d07ba","type":"debug","z":"12ddad45.785b83","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":925.5,"y":231.00094985961914,"wires":[]}]