Skip to content

Add solarcharger as a virtual device type in the victron-virtual node #351

@Kayografix

Description

@Kayografix

feature request related to a problem

I'm unable to create a virtual Solar Charger device from Node‑RED because the existing victron-virtual node does not offer a solarcharger device type. As a result, victron-output-custom nodes cannot reliably publish PV and charger values to com.victronenergy.solarcharger/ DBus paths. This forces me to use fragile workarounds (manual service creation, custom extensions, or writing directly to arbitrary paths), which complicates testing, simulation and integration of external data sources (MQTT/REST) with Victron systems.

concise solution description

Add solarcharger as a selectable virtual device type in the victron-virtual node. When a user creates a solarcharger instance it should register a service such as com.victronenergy.solarcharger/ and expose the common PV and battery DBus paths so victron-output-custom nodes can write to them. Recommended core paths to expose:

/Dc/Voltage (V)

/Dc/Current (A)

/Dc/Power (W)

/Battery/Soc (%)

/State (integer charger state) Optional useful paths: /History/EnergyOut (kWh), Connected flag. The node should allow selecting or auto‑choosing an unused instance number to avoid conflicts with real devices.

alternatives considered

Manually creating services or using a custom node to inject DBus entries (works but is error‑prone and not user friendly).

Using victron-output-custom directly with a custom service name (sometimes accepted, but without a proper virtual device in the UI it is confusing and can conflict with existing devices).

Creating a separate helper package that extends victron-common at runtime (possible, but a fragile local workaround that should not replace an official implementation).

Additional context

This feature enables straightforward simulation and testing of PV systems and allows external data sources (MQTT, REST, sensors) to feed a Victron DBus‑compatible virtual solar charger for development, dashboards and automation. A suggested minimal properties patch for victron-common is:

javascript
properties.solarcharger = {
'Dc/Voltage': { type: 'd', value: 0, immediate: true },
'Dc/Current': { type: 'd', value: 0, immediate: true },
'Dc/Power': { type: 'd', value: 0, immediate: true },
'Battery/Soc':{ type: 'd', min: 0, max: 100, value: 0, immediate: true },
'State': { type: 'i', value: 0, immediate: true },
'History/EnergyOut': { type: 'd', value: 0 },
'Connected': { type: 'i', value: 1 }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions