anchor.diff:  init([]) ->
       Self = self(),
       Mqtt = mqtt_client:connect(),
  -    mqtt_client:subscribe(Mqtt, "#", fun(Topic, Message) ->
  +    mqtt_client:subscribe(Mqtt, "zwave/get/#", fun(Topic, Message) ->
           gen_server:cast(Self, {from_mqtt, Topic, Message})
       end),
  +    ehome_dispatcher:subscribe([mqtt, set, all], self(),
  +        fun([mqtt, set | Topic], Value) ->
  +            gen_server:cast(Self, {to_mqtt, Topic, Value})
  +        end),
       {ok, #state{mqtt = Mqtt}}.
   
   %%--------------------------------------------------------------------
  
positive.code:         dump(Node, NewIndent)
      end, ok, Subs).
  
  convert_value(<<0:8>>) ->
      empty;
  convert_value(<<1:8, 0:8>>) ->
      false;
  convert_value(<<1:8, _:8>>) ->
      true;
  convert_value(<<2:8, Val:32/integer-native>>) ->
      Val;
  convert_value(<<3:8, Val:32/float-native>>) ->
      Val;
  convert_value(<<4:8, Val/binary>>) ->
      binary_to_list(Val);
  convert_value(<<5:8, Val/binary>>) ->
      Val;
  convert_value(Message) ->
      Message.
  
  from_mqtt(["devices", Device, "instances", Instance, "commandClasses", Class,
             "data" | Rest], Message, #state{root = Root} = State) ->
      Path = to_path(Device, Instance, Class, Rest),
      io:format("~p = ~p~n",
          [Path, Message]),
      ehome_dispatcher:publish([mqtt | Path], Message),
      State#state{root = learn(Path, Message, Root)};
  from_mqtt(Unknown, Message, State) ->
      io:format("Unknown message: ~p = ~p~n", [Unknown, Message]),
      State.
  
  to_path(Device, Instance, Class, Rest) ->
      DeviceNum = list_to_integer(Device),
  
negative.code:     end.
  
  name2class(Name) when is_atom(Name) ->
       case lists:keyfind(Name, 1, classes()) of
           {Name, Class} -> integer_to_list(Class);
           Other -> Other
       end;
  name2class(Name) when is_integer(Name) ->
       integer_to_list(Name);
  name2class(Name) when is_list(Name) ->
      Name.
  
  classes() ->
  