XBOS Docs
Search…
EVSE
Interface: i.xbos.evse
Description: Standard XBOS electric vehicle supply equipment (charging station)
PONUM: 2.1.1.7

Properties

Name
Type
Description
Units
Required
charging_time_left
integer
Seconds left until car is fully charged
s
false
current
double
Active charge current
A
true
current_limit
double
Maximum allowed current for charging
A
true
state
boolean
Charge state of the EVSE
on/off
true
time
integer
nanoseconds since the Unix epoch
ns
true
voltage
double
Active charge voltage
V
true

Signals

    info:
      current_limit
      current
      state
      voltage
      charging_time_left
      time

Slots

    state:
      current_limit
      state

Interfacing in Go

1
package main
2
3
import (
4
"fmt"
5
bw2 "gopkg.in/immesys/bw2bind.v5"
6
)
7
8
func main() {
9
client := bw2.ConnectOrExit("")
10
client.OverrideAutoChainTo(true)
11
client.SetEntityFromEnvironOrExit()
12
13
base_uri := "EVSE uri goes here ending in i.xbos.evse"
14
15
// subscribe
16
type signal struct {
17
Current_limit float64 `msgpack:"current_limit"`
18
Current float64 `msgpack:"current"`
19
State bool `msgpack:"state"`
20
Voltage float64 `msgpack:"voltage"`
21
Charging_time_left int64 `msgpack:"charging_time_left"`
22
Time int64 `msgpack:"time"`
23
}
24
c, err := client.Subscribe(&bw2.SubscribeParams{
25
URI: base_uri + "/signal/info",
26
})
27
if err != nil {
28
panic(err)
29
}
30
31
for msg := range c {
32
var current_state signal
33
po := msg.GetOnePODF("2.1.1.7/32")
34
err := po.(bw2.MsgPackPayloadObject).ValueInto(&current_state)
35
if err != nil {
36
fmt.Println(err)
37
} else {
38
fmt.Println(current_state)
39
}
40
}
41
}
Copied!

Interfacing in Python

1
import time
2
import msgpack
3
4
from bw2python.bwtypes import PayloadObject
5
from bw2python.client import Client
6
7
bw_client = Client()
8
bw_client.setEntityFromEnviron()
9
bw_client.overrideAutoChainTo(True)
10
11
def onMessage(bw_message):
12
for po in bw_message.payload_objects:
13
if po.type_dotted == (2,1,1,7):
14
print msgpack.unpackb(po.content)
15
16
bw_client.subscribe("EVSE uri ending in i.xbos.evse/signal/info", onMessage)
17
18
print "Subscribing. Ctrl-C to quit."
19
while True:
20
time.sleep(10000)
Copied!
Last modified 1yr ago