Create virtual hardware

Moderator: leecollings

Post Reply
BBI_home
Posts: 25
Joined: Monday 08 December 2014 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Create virtual hardware

Post by BBI_home »

In the Domoticz API/JSON documentation:

https://www.domoticz.com/wiki/Domoticz_ ... 7s#Counter

there is a command to create virtual hardware:

/json.htm?type=command&param=addhardware&htype=15&port=1&name=Sensors1&enabled=true

Is there a reason to use type=15 or are other types possible and is a list available with alternatives in order to create other types of hardware like general etc.
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Create virtual hardware

Post by paulvha »

Type 15 = dummy hardware layer. In the GUI this is like adding it manually. If you have the sources look at RFXnames.h in main for the list of htypes (~67 these days) A number of other htypes looks to be supported with this Json command: look at webServer.cpp:: Cmd_AddHardware. I have no experience with handling other htype hardware. Dummy works great :-)
User avatar
gizmocuz
Posts: 2484
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Create virtual hardware

Post by gizmocuz »

Just create the hardware via the hardware page (dummy) and not via the json call... much easier
Quality outlives Quantity!
BBI_home
Posts: 25
Joined: Monday 08 December 2014 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware

Post by BBI_home »

And the next step in order to create a Plugwise device with Lan interface, is that also possible to do in a similar way?
BBI_home
Posts: 25
Joined: Monday 08 December 2014 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware + device

Post by BBI_home »

Hi,

I’m a little bit confused about how to setup a hardware and device to connect a Plugwise Smile and Stretch to my Domoticz server.
In order to do this I can setup a dummy device or I can add new hardware as P1 Smart Meter with LAN interface and complete this with IP and port. So far so good.

The next step is to setup/correct the settings of a device. By creating a dummy device there is no new device created, by adding a new P1 Smart Meter LAN hardware a temp+humidity device is created.

Both are wrong because I like to monitor my energy consumption.

My question is how the change my device settings like type to general and subtype to kWh and m3 etc.
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware

Post by RayAmsterdam »

Search the forum on how to setup Plugwise. It isn't supported by Domoticz directly.
BBI_home
Posts: 25
Joined: Monday 08 December 2014 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware

Post by BBI_home »

This has basically nothing to do with a setup of Plugwise itself. It is a the way to setup in general new dummy hardware and needed and correct device in Domoticz what troubles me .
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware

Post by RayAmsterdam »

I meant how to setup Plugwise within Domoticz. There are several threads about this subject. Dummy hardware has nothing to do with Plugwise (and wont work), neither has the P1 hardware in Domoticz.
BBI_home
Posts: 25
Joined: Monday 08 December 2014 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware

Post by BBI_home »

I'm created a dummy hardware with a device. I can see that the data is displayed as data in the list.
Schermafbeelding 2016-02-25 om 10.36.36.png
Schermafbeelding 2016-02-25 om 10.36.36.png (32.34 KiB) Viewed 8129 times
In utility the data is displayed only in small characters in the second line and in my dashboard not at all.
Schermafbeelding 2016-02-25 om 10.35.47.png
Schermafbeelding 2016-02-25 om 10.35.47.png (27.65 KiB) Viewed 8129 times
Schermafbeelding 2016-02-25 om 10.46.08.png
Schermafbeelding 2016-02-25 om 10.46.08.png (24.22 KiB) Viewed 8129 times
I've tried a lot of differed hardware settings, P1 Smart Meter, RFX Meter, General, etc, but without results and I'm looking for suggestions
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Create virtual hardware

Post by paulvha »

I have done the same. I update the gas (and electricity) values with a separate daemon. I already made an interface to collect the P1 values and store that in an Access database. I want to keep that for now, hence i did not use P1 hardware interface in Domoticz.
Where it shows 35.036 for you, it shows my gasmeter value and where it shows 0.000m3 for you it will show the delta to the previous reading (calculated in Domoticz).

You may have a brand new gasmeter, but your value looks low to me. My value is 2200.863. Are you sending your gasmeter values as a float ?

I have attached the daemon (written in Python) and documentation as it might help you. The deamon takes input from a file and has flexible configuration options for the information to parse (often needed to capture the gas information).

regards,
Paul
Attachments
domo-up.gz
(80 KiB) Downloaded 223 times
BBI_home
Posts: 25
Joined: Monday 08 December 2014 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create virtual hardware - kWh instead of Watt

Post by BBI_home »

Thanks, almost everything is now working fine. :D

The only thing I like is to change is the text : "Watt" into "kWh" for a regular Usage type device with Electric subtype
(I use these settings because this gives me the overall and correct information from my P1 Smart Meter and no daily incemental data.)

Is it possible to change the text in the DB directly of with a JSON command?

Unfortunately /json.htm?type=command&param=getuservariables gives no list of values neither does
/json.htm?type=command&param=getuservariable&idx=IDX

Just
{
status: "OK",
title: "GetUserVariable"
}
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest