Skip to content

Commit

Permalink
PowerMeter admin: URL examples to the top and hidden if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Apr 10, 2024
1 parent 165a9bc commit a9c3e05
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions webapp/src/views/PowerMeterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@
wide />
</CardElement>

<div class="alert alert-secondary mt-5" role="alert">
<h2>URL examples:</h2>
<ul>
<li>http://admin:[email protected]/status</li>
<li>https://admin:[email protected]/status</li>
<li>http://tasmota-123.home/cm?cmnd=status%208</li>
<li>http://12.34.56.78/emeter/0</li>
</ul>

<h2>JSON path examples:</h2>
<ul>
<li>total_power - { "othervalue": "blah", "total_power": 123.4 }</li>
<li>testarray/[2]/myvalue - { "testarray": [ {}, { "power": 123.4 } ] }</li>
</ul>

More info: <a href="https://github.com/mobizt/FirebaseJson">https://github.com/mobizt/FirebaseJson</a>
</div>

<CardElement
v-for="(http_phase, index) in powerMeterConfigList.http_phases"
:key="http_phase.index"
Expand Down Expand Up @@ -187,23 +205,6 @@

<FormFooter @reload="getPowerMeterConfig"/>

<div v-if="powerMeterConfigList.source === 3" class="alert alert-secondary" role="alert">
<h2>URL examples:</h2>
<ul>
<li>http://admin:[email protected]/status</li>
<li>https://admin:[email protected]/status</li>
<li>http://tasmota-123.home/cm?cmnd=status%208</li>
<li>http://12.34.56.78/emeter/0</li>
</ul>

<h2>JSON path examples:</h2>
<ul>
<li>total_power - { "othervalue": "blah", "total_power": 123.4 }</li>
<li>testarray/[2]/myvalue - { "testarray": [ {}, { "power": 123.4 } ] }</li>
</ul>

More info: <a href="https://github.com/mobizt/FirebaseJson">https://github.com/mobizt/FirebaseJson</a>
</div>
</form>
</BasePage>
</template>
Expand Down

1 comment on commit a9c3e05

@stefan123t
Copy link

@stefan123t stefan123t commented on a9c3e05 Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schlimmchen Please add Example URL for Shelly Pro3EM which does not support /status URL but only RPC API URL as below:

http://shellypro3em-<mac-address>/rpc/Shelly.GetStatus

The JSON Path is em:0/total_act_power or em:0/a_act_power, em:0/b_act_power and em:0/c_act_power

The example JSON looks like this (reduced to the four elements):

{
  "em:0": {
    "a_act_power": 63.8,
    "b_act_power": -367.8,
    "c_act_power": 8.5,
    "total_act_power": -295.439
  }
}

Please sign in to comment.