view service/rdf_to_mqtt/index.html @ 1754:92999dfbf321 default tip

add shelly support
author drewp@bigasterisk.com
date Tue, 04 Jun 2024 13:03:43 -0700
parents 6b80a6c58907
children
line wrap: on
line source

<!DOCTYPE html>
<html>
  <head>
    <title>rdf_to_mqtt</title>   
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />

    <meta charset="utf-8" />
    <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script>
    <script src="/lib/require/require-2.3.3.js"></script>
    <script src="/rdf/common_paths_and_ns.js"></script>

    <link rel="stylesheet" href="/rdf/browse/style.css" />
    <style>
      button {
        min-height: 50px;
      }
      section {
        margin: 5px;
        display: inline-block;
        vertical-align: top;
      }
    </style>
  </head>
  <body class="rdfBrowsePage">
    rdf_to_mqtt

    <p>Send demo statements to bridge:</p>
    <section>
      <div><button data-post="output?s=:kitchenLight&p=:brightness" data-body="0.0">Send (:kitchenLight :brightness 0.0)</button></div>
      <div><button data-post="output?s=:kitchenLight&p=:brightness" data-body="1.0">Send (:kitchenLight :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:kitchenCounterLight&p=:brightness" data-body="0.0">Send (:kitchenCounterLight :brightness 0.0)</button></div>
      <div><button data-post="output?s=:kitchenCounterLight&p=:brightness" data-body="1.0">Send (:kitchenCounterLight :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:livingLampShelf&p=:brightness" data-body="0.0">Send (:livingLampShelf :brightness 0.0)</button></div>
      <div><button data-post="output?s=:livingLampShelf&p=:brightness" data-body="1.0">Send (:livingLampShelf :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:livingLampMantleEntry&p=:brightness" data-body="0.0">Send (:livingLamp1 :brightness 0.0)</button></div>
      <div><button data-post="output?s=:livingLampMantleEntry&p=:brightness" data-body="1.0">Send (:livingLamp1 :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:livingLampMantleChair&p=:brightness" data-body="0.0">Send (:livingLamp2 :brightness 0.0)</button></div>
      <div><button data-post="output?s=:livingLampMantleChair&p=:brightness" data-body="1.0">Send (:livingLamp2 :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:livingLampToyShelf&p=:brightness" data-body="0.0">Send (:livingLamp3 :brightness 0.0)</button></div>
      <div><button data-post="output?s=:livingLampToyShelf&p=:brightness" data-body="1.0">Send (:livingLamp3 :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:livingLampPiano&p=:brightness" data-body="0.0">Send (:livingLamp4 :brightness 0.0)</button></div>
      <div><button data-post="output?s=:livingLampPiano&p=:brightness" data-body="1.0">Send (:livingLamp4 :brightness 1.0)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:theater&p=:inputSelector" data-body="bd">Theater to chromecast</button></div>
      <div><button data-post="output?s=:theater&p=:inputSelector" data-body="game">Theater to PS4</button></div>
      <div><button data-post="output?s=:theater&p=:inputSelector" data-body="pc">Theater to VR</button></div>
      <div><button data-post="output?s=:theater&p=:inputSelector" data-body="cbl">Theater to PS3</button></div>
      <div><button data-post="output?s=:theater&p=:volumeChange" data-body="3">Theater volume up</button></div>
      <div><button data-post="output?s=:theater&p=:volumeChange" data-body="-3">Theater volume down</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:bedHeadboard&p=:color" data-body="#ffffff">headboard white</button></div>
      <div><button data-post="output?s=:bedHeadboard&p=:color" data-body="#000000">headboard black</button></div>
      <div><button data-post="output?s=:bedHeadboard&p=:color" data-body="#ff0000">headboard red</button></div>
      <div><button data-post="output?s=:bedHeadboard&p=:color" data-body="#00ff00">headboard green</button></div>
      <div><button data-post="output?s=:bedHeadboard&p=:color" data-body="#0000ff">headboard blue</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#ffffff">asher bed bar white</button></div>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#000000">asher bed bar black</button></div>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#ff0000">asher bed bar red 1</button></div>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#880000">asher bed bar red .5</button></div>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#440000">asher bed bar red .25</button></div>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#00ff00">asher bed bar green</button></div>
      <div><button data-post="output?s=:asherBedBar&p=:color" data-body="#0000ff">asher bed bar blue</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:frontRoom1&p=:color" data-body="0*3200K">Send (:frontRoom1 :color black)</button></div>
      <div><button data-post="output?s=:frontRoom1&p=:color" data-body="1*3200K">Send (:frontRoom1 :color white)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:frontRoom2&p=:color" data-body="0*3200K">Send (:frontRoom2 :color black)</button></div>
      <div><button data-post="output?s=:frontRoom2&p=:color" data-body="1*3200K">Send (:frontRoom2 :color white)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:asherCeiling&p=:color" data-body="0*3200K">Send (:asherCeiling :color black)</button></div>
      <div><button data-post="output?s=:asherCeiling&p=:color" data-body=".2*3200K">asherCeiling dim  </button></div>
      <div><button data-post="output?s=:asherCeiling&p=:color" data-body="1*3200K">Send (:asherCeiling :color white)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:noname1&p=:color" data-body="0*3200K">Send (:noname1 :color black)</button></div>
      <div><button data-post="output?s=:noname1&p=:color" data-body="1*3200K">Send (:noname1 :color white)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:noname2&p=:color" data-body="0*3200K">Send (:noname2 :color black)</button></div>
      <div><button data-post="output?s=:noname2&p=:color" data-body="1*3200K">Send (:noname2 :color white)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:noname3&p=:color" data-body="0*3200K">Send (:noname3 :color black)</button></div>
      <div><button data-post="output?s=:noname3&p=:color" data-body="1*3200K">Send (:noname3 :color white)</button></div>
    </section>
    <section>
      <div><button data-post="output?s=:noname4&p=:color" data-body="0*3200K">Send (:noname4 :color black)</button></div>
      <div><button data-post="output?s=:noname4&p=:color" data-body="1*3200K">Send (:noname4 :color white)</button></div>
    </section>
    
    <section>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="0*2200K">Send (:stairTop :color black)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*200K">Send (:stairTop :color white 200K)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*1200K">Send (:stairTop :color white)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*2200K">Send (:stairTop :color white)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*3200K">Send (:stairTop :color white)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*4200K">Send (:stairTop :color white)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*5200K">Send (:stairTop :color white)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="1*6200K">Send (:stairTop :color white 6200K)</button></div>
      <hr>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="0.8*3200K">Send (:stairTop :color white*.8)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="0.6*3200K">Send (:stairTop :color white*.6)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="0.4*3200K">Send (:stairTop :color white*.4)</button></div>
      <div><button data-post="output?s=:stairTop&p=:color" data-body="0.2*3200K">Send (:stairTop :color white*.2)</button></div>
      
    </section>

    <script>
      Array.from(document.querySelectorAll("button")).forEach((el) => {
        el.addEventListener("click", (ev) => {
          fetch(el.dataset.post, {
            method: "PUT",
            body: el.dataset.body,
          });
        });
      });
    </script>

    <div class="served-resources">
      <a href="stats/">/stats/</a>
      <a href="output">/output (post)</a>
    </div>
  </body>
</html>