node-red-contrib-tibber-api
Version:
Node Red module for integrating with Tibber api
236 lines (229 loc) • 11.1 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('tibber-feed', {
category: 'Tibber API',
color: '#23B8CC',
defaults: {
name: {
value: '',
},
active: {
value: true,
},
apiEndpointRef: { value: null, type: 'tibber-api-endpoint' },
homeId: {
value: '',
},
timestamp: {
value: '1',
},
power: {
value: '1',
},
lastMeterConsumption: {
value: '1',
},
accumulatedConsumption: {
value: '1',
},
accumulatedProduction: {
value: '1',
},
accumulatedConsumptionLastHour: {
value: '1',
},
accumulatedProductionLastHour: {
value: '1',
},
accumulatedCost: {
value: '1',
},
accumulatedReward: {
value: '1',
},
currency: {
value: '1',
},
minPower: {
value: '1',
},
averagePower: {
value: '1',
},
maxPower: {
value: '1',
},
powerProduction: {
value: '1',
},
minPowerProduction: {
value: '1',
},
maxPowerProduction: {
value: '1',
},
lastMeterProduction: {
value: '1',
},
powerFactor: {
value: '1',
},
voltagePhase1: {
value: '1',
},
voltagePhase2: {
value: '1',
},
voltagePhase3: {
value: '1',
},
currentL1: {
value: '1',
},
currentL2: {
value: '1',
},
currentL3: {
value: '1',
},
signalStrength: {
value: '1',
},
},
inputs: 0,
outputs: 1,
icon: 'feed.png',
label: function () {
return this.name || 'tibber-feed';
},
});
</script>
<script type="text/x-red" data-template-name="tibber-feed">
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-active"><i class="icon-tag"></i> Active</label>
<input type="checkbox" id="node-input-active" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-apiEndpointRef"><i class="icon-tag"></i> API Endpoint</label>
<input type="text" id="node-input-apiEndpointRef" placeholder="API Endpoint">
</div>
<!-- <div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-apiUrl"><i class="icon-tag"></i> API Url</label>
<input type="text" id="node-input-apiUrl" placeholder="Websocket Url">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-apiToken"><i class="icon-tag"></i> API key</label>
<input type="text" id="node-input-apiToken" placeholder="API key">
</div> -->
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-homeId"><i class="icon-tag"></i> Home id</label>
<input type="text" id="node-input-homeId" placeholder="Home id">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<hr>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-timestamp"><i class="icon-tag"></i> Timestamp</label>
<input type="checkbox" id="node-input-timestamp" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-power"><i class="icon-tag"></i> Power</label>
<input type="checkbox" id="node-input-power" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-lastMeterConsumption"><i class="icon-tag"></i> Last meter consumption</label>
<input type="checkbox" id="node-input-lastMeterConsumption" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-accumulatedConsumption"><i class="icon-tag"></i> Accumulated consumption</label>
<input type="checkbox" id="node-input-accumulatedConsumption" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-accumulatedProduction"><i class="icon-tag"></i> Accumulated production</label>
<input type="checkbox" id="node-input-accumulatedProduction" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-accumulatedConsumptionLastHour"><i class="icon-tag"></i> Accumulated consumption last hour</label>
<input type="checkbox" id="node-input-accumulatedConsumptionLastHour" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-accumulatedProductionLastHour"><i class="icon-tag"></i> Accumulated production last hour</label>
<input type="checkbox" id="node-input-accumulatedProductionLastHour" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-accumulatedCost"><i class="icon-tag"></i> Accumulated cost</label>
<input type="checkbox" id="node-input-accumulatedCost" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-accumulatedReward"><i class="icon-tag"></i> Accumulated reward</label>
<input type="checkbox" id="node-input-accumulatedReward" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-currency"><i class="icon-tag"></i> Currency</label>
<input type="checkbox" id="node-input-currency" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-minPower"><i class="icon-tag"></i> Min power</label>
<input type="checkbox" id="node-input-minPower" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-averagePower"><i class="icon-tag"></i> Average power</label>
<input type="checkbox" id="node-input-averagePower" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-maxPower"><i class="icon-tag"></i> Max power</label>
<input type="checkbox" id="node-input-maxPower" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-powerProduction"><i class="icon-tag"></i> Power production</label>
<input type="checkbox" id="node-input-powerProduction" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-minPowerProduction"><i class="icon-tag"></i> Min power production</label>
<input type="checkbox" id="node-input-minPowerProduction" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-maxPowerProduction"><i class="icon-tag"></i> Max power production</label>
<input type="checkbox" id="node-input-maxPowerProduction" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-lastMeterProduction"><i class="icon-tag"></i> Last meter production</label>
<input type="checkbox" id="node-input-lastMeterProduction" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-powerFactor"><i class="icon-tag"></i> Power factor</label>
<input type="checkbox" id="node-input-powerFactor" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-voltagePhase1"><i class="icon-tag"></i> Voltage phase 1</label>
<input type="checkbox" id="node-input-voltagePhase1" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-voltagePhase2"><i class="icon-tag"></i> Voltage phase 2</label>
<input type="checkbox" id="node-input-voltagePhase2" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-voltagePhase3"><i class="icon-tag"></i> Voltage phase 3</label>
<input type="checkbox" id="node-input-voltagePhase3" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-currentL1"><i class="icon-tag"></i> Current L1</label>
<input type="checkbox" id="node-input-currentL1" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-currentL2"><i class="icon-tag"></i> Current L2</label>
<input type="checkbox" id="node-input-currentL2" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-currentL3"><i class="icon-tag"></i> Current L3</label>
<input type="checkbox" id="node-input-currentL3" value="1">
</div>
<div class="form-row" style="white-space: nowrap;">
<label style="white-space: nowrap;" for="node-input-signalStrength"><i class="icon-tag"></i> Signal strength</label>
<input type="checkbox" id="node-input-signalStrength" value="1">
</div>
</script>
<script type="text/x-red" data-help-name="tibber-api">
<p>A simple node that enables you to stream realtime data from tibber.</p>
</script>