Announcement

Collapse
No announcement yet.

Mqtt and Pjlink (protocol for projector Epson (or other))

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mqtt and Pjlink (protocol for projector Epson (or other))

    Hello

    I want to control my projector with HS3.

    DrhsIpPlugin don't work.

    I found a node-red flow with PjLink protocol to control my Epson TW7300 (or 5040UB in US)

    I have installed plugin McsMqtt on HS3, Mosquitto docker on my NAS qnap TS-451, and Qnap QIOT lite (Node-red by Qnap).

    I added module pjlink in Qiot, and loaded flow from https://flows.nodered.org/node/node-red-contrib-pjlink



    Now, i receive statut from my projector(On = 1, Off = 0, Lamp Status , Name, and Inputs),


    and in can power on or Off from HS3



    Several problems:

    The Status lamp is not good, i want only 375H in device Lamp
    The status Input is not good , I want each input in several devices HDMI1, HDMI2, RGB, Network

    Can help me, please

    For Power On, Off, HS3 send 1 or 0, in node-red i use a node "CHANGE" to change 1 = on, and 0 = off and inject it in node PjLink

    That is ok and i can power ON or OFF by Google Home

    How can i improve my flow between HS3 and My projector?

    I want to select inputs by an event called "Cinema ON" or "Cimena OFF" to start my projector, select input HDMI1 or HDMI2 on projector, close the blind, start my home cinema ,Chose correct input on Home cinema, put Yeelight in mode Cinema, etc...

    Can you help me,

    Thanks,

    My flow in Node-red:

    PHP Code:
    [{"id":"b51823a5.1b8bb","type":"tab","label":"Flow 2"},{"id":"716eee9.a31361","type":"inject","z":"b51823a5.1b8 bb","name":"","topic":"POWER","payload":"on","payloadType":" str","repeat":"","crontab":"","once":false,"x":118,"y":120," wires":[["b37d889.6eb2978"]]},{"id":"a4df02e2.bd90d","type":"debug","z":"b51823a5.1b8bb" ,"name":"Error","active":false,"console":"false","complete""payload","x":784,"y":434,"wires":[]},{"id":"6266a80c.0db038","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"POWER","payload":"off","payloadType":" str","repeat":"","crontab":"","once":false,"x":118,"y":160," wires":[["b37d889.6eb2978"]]},{"id":"b37d889.6eb2978","type":"pjlink","z":"b51823a5.1b8b b","ip":"192.168.50.65","port":4352,"name":"TW7300","x":550"y":379,"wires":[["e121ead8.b98668","fdafcd17.12b1f8","8f3c166c.9a6cf8"],["a4df02e2.bd90d"]]},{"id":"af1f53d7.4bf438","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"TW7300/Name","payload":"getname","payloadType":"str","repeat":"","c rontab":"","once":false,"x":150,"y":440,"wires":[["b37d889.6eb2978"]]},{"id":"e121ead8.b98668","type":"debug","z":"b51823a5.1b8bb ","name":"Out","active":false,"console":"false","complete":" payload","x":782,"y":375,"wires":[]},{"id":"83f46eec.4fee9","type":"inject","z":"b51823a5.1b8bb ","name":"","topic":"","payload":"getmanufacturer","payloadT ype":"str","repeat":"","crontab":"","once":false,"x":124,"y" :320,"wires":[["b37d889.6eb2978"]]},{"id":"2ebcb973.223cde","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"TW7300/Lampe","payload":"getlamps","payloadType":"str","repeat":"36 00","crontab":"","once":false,"x":161.5,"y":360,"wires":[["b37d889.6eb2978"]]},{"id":"d92ea5ab.f9737","type":"inject","z":"b51823a5.1b8bb ","name":"","topic":"TW7300/Sources","payload":"getinputs","payloadType":"str","repeat""","crontab":"","once":false,"x":161.5,"y":400,"wires":[["b37d889.6eb2978"]]},{"id":"427ee6e2.cc9508","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"","payload":"getinfo","payloadType":"s tr","repeat":"","crontab":"","once":false,"x":98,"y":520,"wi res":[["b37d889.6eb2978"]]},{"id":"16136b7c.9a551d","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"TW7300/Power","payload":"getpowerstate","payloadType":"str","repeat ":"","crontab":"","once":false,"x":167,"y":560,"wires":[["b37d889.6eb2978"]]},{"id":"4534b074.9daf8","type":"inject","z":"b51823a5.1b8bb ","name":"","topic":"","payload":"getinput","payloadType":"s tr","repeat":"","crontab":"","once":false,"x":98,"y":480,"wi res":[["b37d889.6eb2978"]]},{"id":"f00e62f7.1ba1b","type":"inject","z":"b51823a5.1b8bb ","name":"","topic":"","payload":"getmodel","payloadType":"s tring","repeat":"","crontab":"","once":false,"x":102,"y":600 ,"wires":[["b37d889.6eb2978"]]},{"id":"7074a4f2.ae25fc","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"","payload":"getmute","payloadType":"s tring","repeat":"","crontab":"","once":false,"x":98.5,"y":28 0,"wires":[["b37d889.6eb2978"]]},{"id":"517162b.c73ea9c","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"","payload":"getclass","payloadType":" string","repeat":"","crontab":"","once":false,"x":98.5,"y":6 40,"wires":[["b37d889.6eb2978"]]},{"id":"1b48c710.89ee41","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"","payload":"geterrors","payloadType""string","repeat":"","crontab":"","once":false,"x":101,"y":6 80,"wires":[["b37d889.6eb2978"]]},{"id":"c9fc8fb5.47f1a8","type":"template","z":"b51823a5.1b 8bb","name":"Set input","field":"payload","fieldType":"msg","syntax":"mustach e","template":"{"setinput": {"source": 3, "channel": 3}}","x":224,"y":720,"wires":[["d1a03915.f35128"]]},{"id":"78448cc0.3d4334","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"","payload":"","payloadType":"str","re peat":"","crontab":"","once":false,"x":98,"y":720,"wires":[["c9fc8fb5.47f1a8"]]},{"id":"d1a03915.f35128","type":"json","z":"b51823a5.1b8bb" ,"name":"","x":358,"y":720,"wires":[["b37d889.6eb2978","b8f0162b.58e478"]]},{"id":"b8cb4adc.b61cf","type":"inject","z":"b51823a5.1b8bb ","name":"","topic":"","payload":"muteon","payloadType":"str ing","repeat":"","crontab":"","once":false,"x":98,"y":200,"w ires":[["b37d889.6eb2978"]]},{"id":"af2ef125.734cc8","type":"inject","z":"b51823a5.1b8b b","name":"","topic":"","payload":"muteoff","payloadType":"s tring","repeat":"","crontab":"","once":false,"x":98,"y":240"wires":[["b37d889.6eb2978"]]},{"id":"8f3c166c.9a6cf8","type":"mqtt out","z":"b51823a5.1b8bb","name":"TW7300","topic":"","qos":" ","retain":"false","broker":"bad7c286.5f0da","x":783.6785888 671875,"y":143.82142639160156,"wires":[]},{"id":"fdafcd17.12b1f8","type":"debug","z":"b51823a5.1b8bb ","name":"","active":true,"console":"false","complete":"true ","x":781.8571166992188,"y":306.1428527832031,"wires":[]},{"id":"3a44968a.dba7da","type":"mqtt in","z":"b51823a5.1b8bb","name":"TW7300 IN","topic":"TW7300/#","qos":"0","broker":"bad7c286.5f0da","x":78,"y":823,"wires ":[["4d81297a.78b4"]]},{"id":"b8f0162b.58e478","type":"debug","z":"b51823a5.1b8bb ","name":"","active":true,"console":"false","complete":"true ","x":791,"y":705,"wires":[]},{"id":"4d81297a.78b4","type":"change","z":"b51823a5.1b8bb" ,"name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"n um","to":"off","tot":"str"},{"t":"change","p":"payload","pt" :"msg","from":"1","fromt":"num","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x" :310,"y":822,"wires":[["b37d889.6eb2978"]]},{"id":"bad7c286.5f0da","type":"mqtt-broker","z":"","broker":"192.168.50.220","port":"1883","clie ntid":"Qnap-Qiot","usetls":false,"compatmode":true,"keepalive":"60","cle ansession":true,"willTopic":"","willQos":"0","willPayload":" ","birthTopic":"","birthQos":"2","birthPayload":""}] 
    Jean francois.

  • #2
    Can you show the MQTT topic(s) that are being delivered by Epson? Or is your question on using Node-Red to decode the Epson protocol to produce MQTT messages?

    From where does 375H come? How are the inputs being presented to mcsMQTT?

    Comment


    • #3
      Hello, Michael

      node-red-contrib-pjlink module is the node to decode protocol pjlink.

      That is OK

      Now, when i inject command getlamp

      Click image for larger version

Name:	Screen Shot 08-04-18 at 08.46 AM.JPG
Views:	48
Size:	44.1 KB
ID:	1238211
      TW7300/Lampe is the topic in Node-red
      375 (now 376) come from the payload in node-red:
      04/08/2018 à 08:05:15fdafcd17.12b1f8TW7300/Lampe : msg : Object{ "_msgid": "1ab4877.fe54b79", "topic": "TW7300/Lampe", "payload": [ { "hours": 376, "on": false } ], "host": "192.168.50.65", "port": 4352 }

      I want to put only The number of hours of utilization in a device .

      Thanks for your help

      Jean-Francois.



      Comment


      • #4
        I am not a Node Red user, but it seems like the topic that is being published has a payload with JSON items hours, on, host and port. Each of these four should appear as four rows on the mcsMQTT Associations tab. When hours row is accepted then HS device with hours value in DeviceValue will be created and then updated each time the topic is received.

        If you are not seeing this then I need some visibility into what is actually being delivered to mcsMQTT from broker. The msMQTT debug should have it. It is enabled from General tab and the collected debug is in /data/mcsMQTT/mcsMQTTdebug.txt.

        Comment


        • #5
          Hello, Michael

          I found some solutions:

          First i add a switch node 1 to split node to paste Hours and "On" to broker , 2 to directly to mqtt broker

          Click image for larger version

Name:	Screen Shot 08-05-18 at 09.32 PM.JPG
Views:	58
Size:	78.3 KB
ID:	1238401

          Click image for larger version

Name:	Screen Shot 08-05-18 at 09.33 PM.JPG
Views:	51
Size:	84.3 KB
ID:	1238402

          I have this in HS3:
          Click image for larger version

Name:	Screen Shot 08-05-18 at 09.38 PM.JPG
Views:	45
Size:	71.7 KB
ID:	1238403

          Click image for larger version

Name:	Screen Shot 08-05-18 at 09.40 PM.JPG
Views:	48
Size:	59.3 KB
ID:	1238404

          Jean-Francois.

          Comment


          • #6
            Can't say I understand what you did. I don't need to understand. Just happy you have what you need from mcsMQTT.

            Comment

            Working...
            X